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:
Owen Anderson
2009-07-13 04:09:18 +00:00
parent f1db120d04
commit 0a5372ed3e
43 changed files with 547 additions and 480 deletions

View File

@ -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: