[llvm-commits] CVS: llvm/lib/Transforms/Utils/DemoteRegToStack.cpp

Chris Lattner lattner at cs.uiuc.edu
Mon Oct 3 17:44:12 PDT 2005



Changes in directory llvm/lib/Transforms/Utils:

DemoteRegToStack.cpp updated: 1.14 -> 1.15
---
Log message:

Fix DemoteRegToStack on an invoke.  This fixes PR634: http://llvm.cs.uiuc.edu/PR634 .


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

 DemoteRegToStack.cpp |    3 ++-
 1 files changed, 2 insertions(+), 1 deletion(-)


Index: llvm/lib/Transforms/Utils/DemoteRegToStack.cpp
diff -u llvm/lib/Transforms/Utils/DemoteRegToStack.cpp:1.14 llvm/lib/Transforms/Utils/DemoteRegToStack.cpp:1.15
--- llvm/lib/Transforms/Utils/DemoteRegToStack.cpp:1.14	Tue Sep 27 14:39:00 2005
+++ llvm/lib/Transforms/Utils/DemoteRegToStack.cpp	Mon Oct  3 19:44:01 2005
@@ -77,6 +77,7 @@
   BasicBlock::iterator InsertPt;
   if (!isa<TerminatorInst>(I)) {
     InsertPt = &I;
+    ++InsertPt;
   } else {
     // We cannot demote invoke instructions to the stack if their normal edge
     // is critical.
@@ -86,7 +87,7 @@
     InsertPt = II.getNormalDest()->begin();
   }
 
-  for (++InsertPt; isa<PHINode>(InsertPt); ++InsertPt)
+  for (; isa<PHINode>(InsertPt); ++InsertPt)
   /* empty */;   // Don't insert before any PHI nodes.
   new StoreInst(&I, Slot, InsertPt);
 






More information about the llvm-commits mailing list