mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-01-29 16:12:44 +00:00
Implement support for the unwind intrinsic in the CBE
llvm-svn: 8116
This commit is contained in:
parent
d7a53f8652
commit
65b451cc4e
@ -1137,6 +1137,19 @@ void CWriter::visitCallInst(CallInst &I) {
|
||||
writeOperand(I.getOperand(2));
|
||||
Out << ")";
|
||||
return;
|
||||
|
||||
case LLVMIntrinsic::unwind:
|
||||
// The unwind intrinsic calls a control flow transfer out of the current
|
||||
// function, unwinding the stack until a caller who used the invoke
|
||||
// instruction is found. In this context, we code generated the invoke
|
||||
// instruction to add an entry to the top of the jmpbuf_list. Thus,
|
||||
// here we just have to longjmp to the specified handler.
|
||||
Out << "if (__llvm_jmpbuf_list == 0) { /* llvm.unwind */\n"
|
||||
<< " printf(\"throw found with no handler!\\n\"); abort();\n"
|
||||
<< " }\n"
|
||||
<< " longjmp(__llvm_jmpbuf_list->buf, 1)";
|
||||
return;
|
||||
|
||||
|
||||
case LLVMIntrinsic::setjmp:
|
||||
case LLVMIntrinsic::sigsetjmp:
|
||||
|
Loading…
x
Reference in New Issue
Block a user