Minor correction to r130877; fixes PR9846 and hopefully the buildbot failures.
[oota-llvm.git] / lib / CodeGen / DwarfEHPrepare.cpp
index 35c25e8a67ba83bda4af51c743c9777f132d8472..34b1a396bb721e706e5b8c8b68b3f7e8ad55d129 100644 (file)
@@ -439,9 +439,9 @@ bool DwarfEHPrepare::NormalizeLandingPads() {
       if (InVal == 0) {
         // Different unwind edges have different values.  Create a new PHI node
         // in NewBB.
-        PHINode *NewPN = PHINode::Create(PN->getType(), PN->getName()+".unwind",
-                                         NewBB);
-        NewPN->reserveOperandSpace(PN->getNumIncomingValues());
+        PHINode *NewPN = PHINode::Create(PN->getType(),
+                                         PN->getNumIncomingValues(),
+                                         PN->getName()+".unwind", NewBB);
         // Add an entry for each unwind edge, using the value from the old PHI.
         for (pred_iterator PI = PB; PI != PE; ++PI)
           NewPN->addIncoming(PN->getIncomingValueForBlock(*PI), *PI);