diff options
author | Owen Anderson <resistor@mac.com> | 2009-07-13 04:09:18 +0000 |
---|---|---|
committer | Owen Anderson <resistor@mac.com> | 2009-07-13 04:09:18 +0000 |
commit | 0a5372ed3e8cda10d724feda3c1a1c998db05ca0 (patch) | |
tree | 89dc39f73d938c223b4e192bc6fd918490a60218 /lib/CodeGen/IntrinsicLowering.cpp | |
parent | f1db120d0494ec55d9265cea7dab22e80dcae10c (diff) |
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
Diffstat (limited to 'lib/CodeGen/IntrinsicLowering.cpp')
-rw-r--r-- | lib/CodeGen/IntrinsicLowering.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/CodeGen/IntrinsicLowering.cpp b/lib/CodeGen/IntrinsicLowering.cpp index 914d703e85..9e6bcd83f3 100644 --- a/lib/CodeGen/IntrinsicLowering.cpp +++ b/lib/CodeGen/IntrinsicLowering.cpp @@ -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: |