mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-13 04:38:24 +00:00
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:
@ -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,
|
||||
|
Reference in New Issue
Block a user