aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/CGStmt.cpp
diff options
context:
space:
mode:
authorOwen Anderson <resistor@mac.com>2009-07-24 23:12:58 +0000
committerOwen Anderson <resistor@mac.com>2009-07-24 23:12:58 +0000
commit4a28d5deeba33722aa009eab488591fb9055cc7e (patch)
tree2036bd7275eb1a0b5139d8a9578d5f4abfec0668 /lib/CodeGen/CGStmt.cpp
parent7caa6825f42a0f7e97d6fc06233133c42b218e46 (diff)
Update for LLVM API change.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77012 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGStmt.cpp')
-rw-r--r--lib/CodeGen/CGStmt.cpp13
1 files changed, 7 insertions, 6 deletions
diff --git a/lib/CodeGen/CGStmt.cpp b/lib/CodeGen/CGStmt.cpp
index 04b26ea80a..5370483ba5 100644
--- a/lib/CodeGen/CGStmt.cpp
+++ b/lib/CodeGen/CGStmt.cpp
@@ -597,7 +597,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(VMContext.getConstantInt(LHS), CaseDest);
+ SwitchInsn->addCase(llvm::ConstantInt::get(VMContext, LHS), CaseDest);
LHS++;
}
return;
@@ -618,10 +618,11 @@ void CodeGenFunction::EmitCaseStmtRange(const CaseStmt &S) {
// Emit range check.
llvm::Value *Diff =
- Builder.CreateSub(SwitchInsn->getCondition(), VMContext.getConstantInt(LHS),
- "tmp");
+ Builder.CreateSub(SwitchInsn->getCondition(),
+ llvm::ConstantInt::get(VMContext, LHS), "tmp");
llvm::Value *Cond =
- Builder.CreateICmpULE(Diff, VMContext.getConstantInt(Range), "tmp");
+ Builder.CreateICmpULE(Diff,
+ llvm::ConstantInt::get(VMContext, Range), "tmp");
Builder.CreateCondBr(Cond, CaseDest, FalseDest);
// Restore the appropriate insertion point.
@@ -640,7 +641,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(VMContext.getConstantInt(CaseVal), CaseDest);
+ SwitchInsn->addCase(llvm::ConstantInt::get(VMContext, CaseVal), CaseDest);
// Recursively emitting the statement is acceptable, but is not wonderful for
// code where we have many case statements nested together, i.e.:
@@ -658,7 +659,7 @@ void CodeGenFunction::EmitCaseStmt(const CaseStmt &S) {
while (NextCase && NextCase->getRHS() == 0) {
CurCase = NextCase;
CaseVal = CurCase->getLHS()->EvaluateAsInt(getContext());
- SwitchInsn->addCase(VMContext.getConstantInt(CaseVal), CaseDest);
+ SwitchInsn->addCase(llvm::ConstantInt::get(VMContext, CaseVal), CaseDest);
NextCase = dyn_cast<CaseStmt>(CurCase->getSubStmt());
}