diff options
| author | Chris Lattner <sabre@nondot.org> | 2004-02-15 22:24:51 +0000 |
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2004-02-15 22:24:51 +0000 |
| commit | 303ca1e5094f2a9b4d683992cd1a1c062cbc06c7 (patch) | |
| tree | e0b181be6c0c58ea33f0d4e9f3148966fa1239ce /llvm/lib/VMCore | |
| parent | d85e0615754cf173fb410632c54f19b59fdf9b4c (diff) | |
| download | bcm5719-llvm-303ca1e5094f2a9b4d683992cd1a1c062cbc06c7.tar.gz bcm5719-llvm-303ca1e5094f2a9b4d683992cd1a1c062cbc06c7.zip | |
By default, llvm.setjmp/llvm.longjmp intrinsics get lowered to their libc counterparts
llvm-svn: 11483
Diffstat (limited to 'llvm/lib/VMCore')
| -rw-r--r-- | llvm/lib/VMCore/IntrinsicLowering.cpp | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/llvm/lib/VMCore/IntrinsicLowering.cpp b/llvm/lib/VMCore/IntrinsicLowering.cpp index ae16c6f96cd..b199ad38331 100644 --- a/llvm/lib/VMCore/IntrinsicLowering.cpp +++ b/llvm/lib/VMCore/IntrinsicLowering.cpp @@ -81,13 +81,25 @@ void DefaultIntrinsicLowering::LowerIntrinsicCall(CallInst *CI) { // never optimized (ie, right out of the CFE), or if it has been hacked on // by the lowerinvoke pass. In both cases, the right thing to do is to // convert the call to an explicit setjmp or longjmp call. - case Intrinsic::setjmp: - case Intrinsic::sigsetjmp: + case Intrinsic::setjmp: { + static Function *SetjmpFCache = 0; + Value *V = ReplaceCallWith("setjmp", CI, CI->op_begin()+1, CI->op_end(), + Type::IntTy, SetjmpFCache); if (CI->getType() != Type::VoidTy) - CI->replaceAllUsesWith(Constant::getNullValue(CI->getType())); + CI->replaceAllUsesWith(V); break; + } + case Intrinsic::sigsetjmp: + if (CI->getType() != Type::VoidTy) + CI->replaceAllUsesWith(Constant::getNullValue(CI->getType())); + break; case Intrinsic::longjmp: + static Function *LongjmpFCache = 0; + ReplaceCallWith("longjmp", CI, CI->op_begin()+1, CI->op_end(), + Type::VoidTy, LongjmpFCache); + break; + case Intrinsic::siglongjmp: // Insert the call to abort static Function *AbortFCache = 0; |

