From 0a205a459884ec745df1c529396dd921f029dafd Mon Sep 17 00:00:00 2001 From: Owen Anderson Date: Sun, 5 Jul 2009 22:41:43 +0000 Subject: More LLVMContext-ification. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74807 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Transforms/Utils/LowerSwitch.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'lib/Transforms/Utils/LowerSwitch.cpp') diff --git a/lib/Transforms/Utils/LowerSwitch.cpp b/lib/Transforms/Utils/LowerSwitch.cpp index 1da5936..ed6eca6 100644 --- a/lib/Transforms/Utils/LowerSwitch.cpp +++ b/lib/Transforms/Utils/LowerSwitch.cpp @@ -18,6 +18,7 @@ #include "llvm/Constants.h" #include "llvm/Function.h" #include "llvm/Instructions.h" +#include "llvm/LLVMContext.h" #include "llvm/Pass.h" #include "llvm/ADT/STLExtras.h" #include "llvm/Support/Debug.h" @@ -200,11 +201,11 @@ BasicBlock* LowerSwitch::newLeafBlock(CaseRange& Leaf, Value* Val, "SwitchLeaf", NewLeaf); } else { // Emit V-Lo <=u Hi-Lo - Constant* NegLo = ConstantExpr::getNeg(Leaf.Low); + Constant* NegLo = Context->getConstantExprNeg(Leaf.Low); Instruction* Add = BinaryOperator::CreateAdd(Val, NegLo, Val->getName()+".off", NewLeaf); - Constant *UpperBound = ConstantExpr::getAdd(NegLo, Leaf.High); + Constant *UpperBound = Context->getConstantExprAdd(NegLo, Leaf.High); Comp = new ICmpInst(ICmpInst::ICMP_ULE, Add, UpperBound, "SwitchLeaf", NewLeaf); } -- cgit v1.1