diff options
Diffstat (limited to 'lib/Transforms/Utils')
-rw-r--r-- | lib/Transforms/Utils/InlineFunction.cpp | 2 | ||||
-rw-r--r-- | lib/Transforms/Utils/LowerAllocations.cpp | 8 | ||||
-rw-r--r-- | lib/Transforms/Utils/LowerInvoke.cpp | 2 | ||||
-rw-r--r-- | lib/Transforms/Utils/LowerSwitch.cpp | 4 |
4 files changed, 8 insertions, 8 deletions
diff --git a/lib/Transforms/Utils/InlineFunction.cpp b/lib/Transforms/Utils/InlineFunction.cpp index 16d8879436..cdde678d75 100644 --- a/lib/Transforms/Utils/InlineFunction.cpp +++ b/lib/Transforms/Utils/InlineFunction.cpp @@ -322,7 +322,7 @@ bool llvm::InlineFunction(CallSite CS, CallGraph *CG, const TargetData *TD) { Value *Size; if (TD == 0) - Size = Context.getConstantExprSizeOf(AggTy); + Size = ConstantExpr::getSizeOf(AggTy); else Size = ConstantInt::get(Type::Int64Ty, TD->getTypeStoreSize(AggTy)); diff --git a/lib/Transforms/Utils/LowerAllocations.cpp b/lib/Transforms/Utils/LowerAllocations.cpp index 68108fa0f2..522166d6f2 100644 --- a/lib/Transforms/Utils/LowerAllocations.cpp +++ b/lib/Transforms/Utils/LowerAllocations.cpp @@ -121,9 +121,9 @@ bool LowerAllocations::runOnBasicBlock(BasicBlock &BB) { MallocArg = ConstantInt::get(Type::Int64Ty, TD.getTypeAllocSize(AllocTy)); else - MallocArg = Context.getConstantExprSizeOf(AllocTy); + MallocArg = ConstantExpr::getSizeOf(AllocTy); MallocArg = - Context.getConstantExprTruncOrBitCast(cast<Constant>(MallocArg), + ConstantExpr::getTruncOrBitCast(cast<Constant>(MallocArg), IntPtrTy); if (MI->isArrayAllocation()) { @@ -132,8 +132,8 @@ bool LowerAllocations::runOnBasicBlock(BasicBlock &BB) { MallocArg = MI->getOperand(0); // Operand * 1 = Operand } else if (Constant *CO = dyn_cast<Constant>(MI->getOperand(0))) { CO = - Context.getConstantExprIntegerCast(CO, IntPtrTy, false /*ZExt*/); - MallocArg = Context.getConstantExprMul(CO, + ConstantExpr::getIntegerCast(CO, IntPtrTy, false /*ZExt*/); + MallocArg = ConstantExpr::getMul(CO, cast<Constant>(MallocArg)); } else { Value *Scale = MI->getOperand(0); diff --git a/lib/Transforms/Utils/LowerInvoke.cpp b/lib/Transforms/Utils/LowerInvoke.cpp index b75b2ef4f5..b880734c14 100644 --- a/lib/Transforms/Utils/LowerInvoke.cpp +++ b/lib/Transforms/Utils/LowerInvoke.cpp @@ -190,7 +190,7 @@ void LowerInvoke::createAbortMessage(Module *M) { GlobalValue::InternalLinkage, Msg, "abortmsg"); std::vector<Constant*> GEPIdx(2, Context.getNullValue(Type::Int32Ty)); - AbortMessage = Context.getConstantExprGetElementPtr(MsgGV, &GEPIdx[0], 2); + AbortMessage = ConstantExpr::getGetElementPtr(MsgGV, &GEPIdx[0], 2); } else { // The abort message for cheap EH support tells the user that EH is not // enabled. diff --git a/lib/Transforms/Utils/LowerSwitch.cpp b/lib/Transforms/Utils/LowerSwitch.cpp index 0f1e719e4c..c330a480d6 100644 --- a/lib/Transforms/Utils/LowerSwitch.cpp +++ b/lib/Transforms/Utils/LowerSwitch.cpp @@ -200,11 +200,11 @@ BasicBlock* LowerSwitch::newLeafBlock(CaseRange& Leaf, Value* Val, "SwitchLeaf"); } else { // Emit V-Lo <=u Hi-Lo - Constant* NegLo = Context.getConstantExprNeg(Leaf.Low); + Constant* NegLo = ConstantExpr::getNeg(Leaf.Low); Instruction* Add = BinaryOperator::CreateAdd(Val, NegLo, Val->getName()+".off", NewLeaf); - Constant *UpperBound = Context.getConstantExprAdd(NegLo, Leaf.High); + Constant *UpperBound = ConstantExpr::getAdd(NegLo, Leaf.High); Comp = new ICmpInst(*NewLeaf, ICmpInst::ICMP_ULE, Add, UpperBound, "SwitchLeaf"); } |