summaryrefslogtreecommitdiff
path: root/lib/Transforms/Utils/CloneFunction.cpp
diff options
context:
space:
mode:
authorOwen Anderson <resistor@mac.com>2009-07-06 18:42:36 +0000
committerOwen Anderson <resistor@mac.com>2009-07-06 18:42:36 +0000
commit508955156a25a9abc470a29e1760aa176d341cf9 (patch)
tree8b7b55caabc0fbb16b6025f38e84ebc4fbd79c31 /lib/Transforms/Utils/CloneFunction.cpp
parente034393b15bc9257314b0c7adfb778e0c504bed7 (diff)
downloadllvm-508955156a25a9abc470a29e1760aa176d341cf9.tar.gz
llvm-508955156a25a9abc470a29e1760aa176d341cf9.tar.bz2
llvm-508955156a25a9abc470a29e1760aa176d341cf9.tar.xz
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
Diffstat (limited to 'lib/Transforms/Utils/CloneFunction.cpp')
-rw-r--r--lib/Transforms/Utils/CloneFunction.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/Transforms/Utils/CloneFunction.cpp b/lib/Transforms/Utils/CloneFunction.cpp
index c8f4efd05f..de1463b9b2 100644
--- a/lib/Transforms/Utils/CloneFunction.cpp
+++ b/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,