diff options
Diffstat (limited to 'lib/Transforms/Utils/Local.cpp')
-rw-r--r-- | lib/Transforms/Utils/Local.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/Transforms/Utils/Local.cpp b/lib/Transforms/Utils/Local.cpp index 179f29cdaf..130b876ee9 100644 --- a/lib/Transforms/Utils/Local.cpp +++ b/lib/Transforms/Utils/Local.cpp @@ -171,8 +171,10 @@ bool llvm::ConstantFoldTerminator(BasicBlock *BB, bool DeleteDeadConditions) { SwitchInst::CaseIt FirstCase = SI->case_begin(); ConstantRangesSet CRS = FirstCase.getCaseValueEx(); if (CRS.getNumItems() == 1 && CRS.isSingleNumber(0)) { + // FIXME: Currently work with ConstantInt based numbers. Value *Cond = Builder.CreateICmpEQ(SI->getCondition(), - CRS.getItem(0).Low, "cond"); + CRS.getItem(0).Low.toConstantInt(), + "cond"); // Insert the new branch. Builder.CreateCondBr(Cond, FirstCase.getCaseSuccessor(), |