mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-13 04:38:24 +00:00
Begin the painful process of tearing apart the rat'ss nest that is Constants.cpp and ConstantFold.cpp.
This involves temporarily hard wiring some parts to use the global context. This isn't ideal, but it's the only way I could figure out to make this process vaguely incremental. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75445 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -315,6 +315,7 @@ static void ReplaceFPIntrinsicWithCall(CallInst *CI, const char *Fname,
|
||||
|
||||
void IntrinsicLowering::LowerIntrinsicCall(CallInst *CI) {
|
||||
IRBuilder<> Builder(CI->getParent(), CI);
|
||||
LLVMContext *Context = CI->getParent()->getContext();
|
||||
|
||||
Function *Callee = CI->getCalledFunction();
|
||||
assert(Callee && "Cannot lower an indirect call!");
|
||||
@ -340,7 +341,7 @@ void IntrinsicLowering::LowerIntrinsicCall(CallInst *CI) {
|
||||
}
|
||||
case Intrinsic::sigsetjmp:
|
||||
if (CI->getType() != Type::VoidTy)
|
||||
CI->replaceAllUsesWith(Constant::getNullValue(CI->getType()));
|
||||
CI->replaceAllUsesWith(Context->getNullValue(CI->getType()));
|
||||
break;
|
||||
|
||||
case Intrinsic::longjmp: {
|
||||
@ -387,7 +388,7 @@ void IntrinsicLowering::LowerIntrinsicCall(CallInst *CI) {
|
||||
"save" : "restore") << " intrinsic.\n";
|
||||
Warned = true;
|
||||
if (Callee->getIntrinsicID() == Intrinsic::stacksave)
|
||||
CI->replaceAllUsesWith(Constant::getNullValue(CI->getType()));
|
||||
CI->replaceAllUsesWith(Context->getNullValue(CI->getType()));
|
||||
break;
|
||||
}
|
||||
|
||||
@ -422,7 +423,7 @@ void IntrinsicLowering::LowerIntrinsicCall(CallInst *CI) {
|
||||
case Intrinsic::eh_exception:
|
||||
case Intrinsic::eh_selector_i32:
|
||||
case Intrinsic::eh_selector_i64:
|
||||
CI->replaceAllUsesWith(Constant::getNullValue(CI->getType()));
|
||||
CI->replaceAllUsesWith(Context->getNullValue(CI->getType()));
|
||||
break;
|
||||
|
||||
case Intrinsic::eh_typeid_for_i32:
|
||||
|
Reference in New Issue
Block a user