diff options
author | Owen Anderson <resistor@mac.com> | 2009-07-16 18:09:38 +0000 |
---|---|---|
committer | Owen Anderson <resistor@mac.com> | 2009-07-16 18:09:38 +0000 |
commit | 9cdd637312a5572287de0fb8637b252ee09cef10 (patch) | |
tree | 0ea78b5af95b4b10b6c1a68b8805b174fa55cd0b /lib/CodeGen/CGStmt.cpp | |
parent | 9f8a04f3ed589de0a2e9fec855177dc0f185bfa9 (diff) |
Update for LLVM API change.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76090 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGStmt.cpp')
-rw-r--r-- | lib/CodeGen/CGStmt.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/CodeGen/CGStmt.cpp b/lib/CodeGen/CGStmt.cpp index b67996c676..32477a3cb7 100644 --- a/lib/CodeGen/CGStmt.cpp +++ b/lib/CodeGen/CGStmt.cpp @@ -570,7 +570,7 @@ void CodeGenFunction::EmitCaseStmtRange(const CaseStmt &S) { if (Range.ult(llvm::APInt(Range.getBitWidth(), 64))) { // Range is small enough to add multiple switch instruction cases. for (unsigned i = 0, e = Range.getZExtValue() + 1; i != e; ++i) { - SwitchInsn->addCase(llvm::ConstantInt::get(LHS), CaseDest); + SwitchInsn->addCase(VMContext.getConstantInt(LHS), CaseDest); LHS++; } return; @@ -591,10 +591,10 @@ void CodeGenFunction::EmitCaseStmtRange(const CaseStmt &S) { // Emit range check. llvm::Value *Diff = - Builder.CreateSub(SwitchInsn->getCondition(), llvm::ConstantInt::get(LHS), + Builder.CreateSub(SwitchInsn->getCondition(), VMContext.getConstantInt(LHS), "tmp"); llvm::Value *Cond = - Builder.CreateICmpULE(Diff, llvm::ConstantInt::get(Range), "tmp"); + Builder.CreateICmpULE(Diff, VMContext.getConstantInt(Range), "tmp"); Builder.CreateCondBr(Cond, CaseDest, FalseDest); // Restore the appropriate insertion point. @@ -613,7 +613,7 @@ void CodeGenFunction::EmitCaseStmt(const CaseStmt &S) { EmitBlock(createBasicBlock("sw.bb")); llvm::BasicBlock *CaseDest = Builder.GetInsertBlock(); llvm::APSInt CaseVal = S.getLHS()->EvaluateAsInt(getContext()); - SwitchInsn->addCase(llvm::ConstantInt::get(CaseVal), CaseDest); + SwitchInsn->addCase(VMContext.getConstantInt(CaseVal), CaseDest); // Recursively emitting the statement is acceptable, but is not wonderful for // code where we have many case statements nested together, i.e.: @@ -631,7 +631,7 @@ void CodeGenFunction::EmitCaseStmt(const CaseStmt &S) { while (NextCase && NextCase->getRHS() == 0) { CurCase = NextCase; CaseVal = CurCase->getLHS()->EvaluateAsInt(getContext()); - SwitchInsn->addCase(llvm::ConstantInt::get(CaseVal), CaseDest); + SwitchInsn->addCase(VMContext.getConstantInt(CaseVal), CaseDest); NextCase = dyn_cast<CaseStmt>(CurCase->getSubStmt()); } |