[llvm-commits] [dragonegg] r128539 - /dragonegg/trunk/Convert.cpp
Duncan Sands
baldrick at free.fr
Wed Mar 30 06:02:14 PDT 2011
Author: baldrick
Date: Wed Mar 30 08:02:14 2011
New Revision: 128539
URL: http://llvm.org/viewvc/llvm-project?rev=128539&view=rev
Log:
Adjust for removal of PHINode::reserveOperandSpace and change to
CreatePHI.
Modified:
dragonegg/trunk/Convert.cpp
Modified: dragonegg/trunk/Convert.cpp
URL: http://llvm.org/viewvc/llvm-project/dragonegg/trunk/Convert.cpp?rev=128539&r1=128538&r2=128539&view=diff
==============================================================================
--- dragonegg/trunk/Convert.cpp (original)
+++ dragonegg/trunk/Convert.cpp Wed Mar 30 08:02:14 2011
@@ -908,7 +908,6 @@
}
// Add the operands to the phi node.
- P.PHI->reserveOperandSpace(PhiArguments.size());
for (ValueVector::iterator I = PhiArguments.begin(), E = PhiArguments.end();
I != E; ++I)
P.PHI->addIncoming(I->second, I->first);
@@ -1102,7 +1101,7 @@
// Create the LLVM phi node.
const Type *Ty = GetRegType(TREE_TYPE(gimple_phi_result(gcc_phi)));
- PHINode *PHI = Builder.CreatePHI(Ty);
+ PHINode *PHI = Builder.CreatePHI(Ty, gimple_phi_num_args(gcc_phi));
// The phi defines the associated ssa name.
tree name = gimple_phi_result(gcc_phi);
@@ -1967,8 +1966,8 @@
if (InVal == 0) {
// Different unwind edges have different values. Create a new PHI node
// in LPad.
- PHINode *NewPN = PHINode::Create(PN->getType(), PN->getName()+".lpad",
- LPad);
+ PHINode *NewPN = PHINode::Create(PN->getType(), std::distance(PB, PE),
+ PN->getName()+".lpad", LPad);
// 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);
More information about the llvm-commits
mailing list