// Now we can emit a switch statement using the call as a value.
SwitchInst *TheSwitch =
new SwitchInst(ConstantUInt::getNullValue(Type::UShortTy),
- codeReplacer, codeReplacer);
+ codeReplacer, 0, codeReplacer);
// Since there may be multiple exits from the original region, make the new
// function return an unsigned, switch on that number. This loop iterates
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);
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)