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

Chris Lattner lattner at cs.uiuc.edu
Thu Sep 29 10:44:31 PDT 2005



Changes in directory llvm/lib/Transforms/Scalar:

LowerInvoke.cpp updated: 1.31 -> 1.32
---
Log message:

Insert stores after phi nodes in the normal dest.  This fixes 
LowerInvoke/2005-08-03-InvokeWithPHI.ll


---
Diffs of the changes:  (+5 -2)

 LowerInvoke.cpp |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)


Index: llvm/lib/Transforms/Scalar/LowerInvoke.cpp
diff -u llvm/lib/Transforms/Scalar/LowerInvoke.cpp:1.31 llvm/lib/Transforms/Scalar/LowerInvoke.cpp:1.32
--- llvm/lib/Transforms/Scalar/LowerInvoke.cpp:1.31	Tue Sep 27 17:44:59 2005
+++ llvm/lib/Transforms/Scalar/LowerInvoke.cpp	Thu Sep 29 12:44:20 2005
@@ -259,8 +259,11 @@
   // Insert a store of the invoke num before the invoke and store zero into the
   // location afterward.
   new StoreInst(InvokeNoC, InvokeNum, true, II);  // volatile
-  new StoreInst(Constant::getNullValue(Type::UIntTy), InvokeNum, false,
-                II->getNormalDest()->begin());  // nonvolatile.
+  
+  BasicBlock::iterator NI = II->getNormalDest()->begin();
+  while (isa<PHINode>(NI)) ++NI;
+  // nonvolatile.
+  new StoreInst(Constant::getNullValue(Type::UIntTy), InvokeNum, false, NI);
   
   // Add a switch case to our unwind block.
   CatchSwitch->addCase(InvokeNoC, II->getUnwindDest());






More information about the llvm-commits mailing list