mirror of
https://github.com/RPCSX/llvm.git
synced 2025-02-04 03:17:51 +00:00
By default, llvm.setjmp/llvm.longjmp intrinsics get lowered to their libc counterparts
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11483 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
860a16143c
commit
9b700f7951
@ -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;
|
||||
|
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user