1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-22 04:22:57 +02:00

When inserting code, make sure not to insert it before PHI nodes. This

fixes PR612 and Transforms/LowerInvoke/2005-08-03-InvokeWithPHI.ll

llvm-svn: 22626
This commit is contained in:
Chris Lattner 2005-08-03 18:34:29 +00:00
parent a9161fc936
commit edac412122

View File

@ -283,7 +283,9 @@ bool LowerInvoke::insertExpensiveEHSupport(Function &F) {
// Create the receiver block if there is a critical edge to the normal
// destination.
SplitCriticalEdge(II, 0, this);
Instruction *InsertLoc = II->getNormalDest()->begin();
BasicBlock::iterator InsertLoc = II->getNormalDest()->begin();
while (isa<PHINode>(InsertLoc)) ++InsertLoc;
// Insert a normal call instruction on the normal execution path.
std::string Name = II->getName(); II->setName("");