Thread LLVMContext through the constant folding APIs, which touches a lot of files.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74844 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Owen Anderson
2009-07-06 18:42:36 +00:00
parent e034393b15
commit 508955156a
21 changed files with 256 additions and 195 deletions

View File

@ -338,7 +338,8 @@ ConstantFoldMappedInstruction(const Instruction *I) {
if (const CmpInst *CI = dyn_cast<CmpInst>(I))
return ConstantFoldCompareInstOperands(CI->getPredicate(),
&Ops[0], Ops.size(), TD);
&Ops[0], Ops.size(),
Context, TD);
if (const LoadInst *LI = dyn_cast<LoadInst>(I))
if (ConstantExpr *CE = dyn_cast<ConstantExpr>(Ops[0]))
@ -346,10 +347,10 @@ ConstantFoldMappedInstruction(const Instruction *I) {
if (GlobalVariable *GV = dyn_cast<GlobalVariable>(CE->getOperand(0)))
if (GV->isConstant() && GV->hasDefinitiveInitializer())
return ConstantFoldLoadThroughGEPConstantExpr(GV->getInitializer(),
CE);
CE, Context);
return ConstantFoldInstOperands(I->getOpcode(), I->getType(), &Ops[0],
Ops.size(), TD);
Ops.size(), Context, TD);
}
/// CloneAndPruneFunctionInto - This works exactly like CloneFunctionInto,