Reserve space for PHI operands

llvm-svn: 9007
This commit is contained in:
Chris Lattner 2003-10-10 16:34:58 +00:00
parent e285b410fa
commit 8ad183194b
1 changed files with 1 additions and 0 deletions

View File

@ -1649,6 +1649,7 @@ InstVal : ArithmeticOps Types ValueRef ',' ValueRef {
| PHI PHIList {
const Type *Ty = $2->front().first->getType();
$$ = new PHINode(Ty);
$$->op_reserve($2->size()*2);
while ($2->begin() != $2->end()) {
if ($2->front().first->getType() != Ty)
ThrowException("All elements of a PHI node must be of the same type!");