(Almost) always call reserveOperandSpace() on newly created PHINodes.

llvm-svn: 128535
This commit is contained in:
Jay Foad
2011-03-30 11:19:20 +00:00
parent 27e20c3c58
commit e0938d8a87
26 changed files with 54 additions and 21 deletions

View File

@@ -117,6 +117,7 @@ bool UnifyFunctionExitNodes::runOnFunction(Function &F) {
} else {
// If the function doesn't return void... add a PHI node to the block...
PN = PHINode::Create(F.getReturnType(), "UnifiedRetVal");
PN->reserveOperandSpace(ReturningBlocks.size());
NewRetBlock->getInstList().push_back(PN);
ReturnInst::Create(F.getContext(), PN, NewRetBlock);
}