switchinst ctor now takes a hint for the number of cases that it will have.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19898 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner
2005-01-29 00:38:26 +00:00
parent 5598aa0328
commit 378805969e
2 changed files with 3 additions and 3 deletions

View File

@@ -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)