mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-08-09 11:25:55 +00:00
When inserting code, make sure not to insert it before PHI nodes. This
fixes PR612 and Transforms/LowerInvoke/2005-08-03-InvokeWithPHI.ll git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22626 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -283,7 +283,9 @@ bool LowerInvoke::insertExpensiveEHSupport(Function &F) {
|
|||||||
// Create the receiver block if there is a critical edge to the normal
|
// Create the receiver block if there is a critical edge to the normal
|
||||||
// destination.
|
// destination.
|
||||||
SplitCriticalEdge(II, 0, this);
|
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.
|
// Insert a normal call instruction on the normal execution path.
|
||||||
std::string Name = II->getName(); II->setName("");
|
std::string Name = II->getName(); II->setName("");
|
||||||
|
Reference in New Issue
Block a user