[llvm-commits] CVS: llvm/lib/Transforms/Scalar/LowerInvoke.cpp

Chris Lattner lattner at cs.uiuc.edu
Wed Aug 3 11:34:40 PDT 2005



Changes in directory llvm/lib/Transforms/Scalar:

LowerInvoke.cpp updated: 1.26 -> 1.27
---
Log message:

When inserting code, make sure not to insert it before PHI nodes.  This
fixes PR612: http://llvm.cs.uiuc.edu/PR612  and Transforms/LowerInvoke/2005-08-03-InvokeWithPHI.ll


---
Diffs of the changes:  (+3 -1)

 LowerInvoke.cpp |    4 +++-
 1 files changed, 3 insertions(+), 1 deletion(-)


Index: llvm/lib/Transforms/Scalar/LowerInvoke.cpp
diff -u llvm/lib/Transforms/Scalar/LowerInvoke.cpp:1.26 llvm/lib/Transforms/Scalar/LowerInvoke.cpp:1.27
--- llvm/lib/Transforms/Scalar/LowerInvoke.cpp:1.26	Wed Jun  8 22:32:54 2005
+++ llvm/lib/Transforms/Scalar/LowerInvoke.cpp	Wed Aug  3 13:34:29 2005
@@ -283,7 +283,9 @@
       // 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("");






More information about the llvm-commits mailing list