diff options
Diffstat (limited to 'lib/Transforms/Utils/SimplifyCFG.cpp')
-rw-r--r-- | lib/Transforms/Utils/SimplifyCFG.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/Transforms/Utils/SimplifyCFG.cpp b/lib/Transforms/Utils/SimplifyCFG.cpp index f4d02573cd..5e282279e3 100644 --- a/lib/Transforms/Utils/SimplifyCFG.cpp +++ b/lib/Transforms/Utils/SimplifyCFG.cpp @@ -518,7 +518,7 @@ static bool FoldValueComparisonIntoPredecessors(TerminatorInst *TI) { AddPredecessorToBlock(NewSuccessors[i], Pred, BB); // Now that the successors are updated, create the new Switch instruction. - SwitchInst *NewSI = new SwitchInst(CV, PredDefault, PTI); + SwitchInst *NewSI = new SwitchInst(CV, PredDefault, PredCases.size(),PTI); for (unsigned i = 0, e = PredCases.size(); i != e; ++i) NewSI->addCase(PredCases[i].first, PredCases[i].second); @@ -1209,7 +1209,7 @@ bool llvm::SimplifyCFG(BasicBlock *BB) { if (!TrueWhenEqual) std::swap(DefaultBB, EdgeBB); // Create the new switch instruction now. - SwitchInst *New = new SwitchInst(CompVal, DefaultBB, BI); + SwitchInst *New = new SwitchInst(CompVal, DefaultBB,Values.size(),BI); // Add all of the 'cases' to the switch instruction. for (unsigned i = 0, e = Values.size(); i != e; ++i) |