diff options
author | Owen Anderson <resistor@mac.com> | 2009-07-06 18:42:36 +0000 |
---|---|---|
committer | Owen Anderson <resistor@mac.com> | 2009-07-06 18:42:36 +0000 |
commit | 39f00cc1d459f02d3a1c115b40d7560f93b22908 (patch) | |
tree | 98282993fa2ebf9ea18d22abf5f59320cc4cfb50 /llvm/lib/Transforms/Utils/CloneFunction.cpp | |
parent | 0578e4386296e7c59efe99499af6878f33ff3bb4 (diff) | |
download | llvm-39f00cc1d459f02d3a1c115b40d7560f93b22908.zip llvm-39f00cc1d459f02d3a1c115b40d7560f93b22908.tar.gz llvm-39f00cc1d459f02d3a1c115b40d7560f93b22908.tar.bz2 |
Thread LLVMContext through the constant folding APIs, which touches a lot of files.
llvm-svn: 74844
Diffstat (limited to 'llvm/lib/Transforms/Utils/CloneFunction.cpp')
-rw-r--r-- | llvm/lib/Transforms/Utils/CloneFunction.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/llvm/lib/Transforms/Utils/CloneFunction.cpp b/llvm/lib/Transforms/Utils/CloneFunction.cpp index c8f4efd..de1463b 100644 --- a/llvm/lib/Transforms/Utils/CloneFunction.cpp +++ b/llvm/lib/Transforms/Utils/CloneFunction.cpp @@ -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, |