Fix PR#50

llvm-svn: 9227
This commit is contained in:
Chris Lattner 2003-10-18 06:14:59 +00:00
parent 5b33748497
commit b32f5748b7
1 changed files with 6 additions and 6 deletions

View File

@ -269,12 +269,12 @@ void PromoteMem2Reg::run() {
// At this point, the blocks left in the preds list must have dummy
// entries inserted into every PHI nodes for the block.
for (unsigned i = 0, e = PNs.size(); i != e; ++i) {
PHINode *PN = PNs[i];
Value *NullVal = Constant::getNullValue(PN->getType());
for (unsigned pred = 0, e = Preds.size(); pred != e; ++pred)
PN->addIncoming(NullVal, Preds[pred]);
}
for (unsigned i = 0, e = PNs.size(); i != e; ++i)
if (PHINode *PN = PNs[i]) {
Value *NullVal = Constant::getNullValue(PN->getType());
for (unsigned pred = 0, e = Preds.size(); pred != e; ++pred)
PN->addIncoming(NullVal, Preds[pred]);
}
}
}
}