[llvm-commits] [llvm] r144000 - /llvm/trunk/lib/Transforms/Utils/DemoteRegToStack.cpp

Bill Wendling isanbard at gmail.com
Mon Nov 7 11:38:34 PST 2011


Author: void
Date: Mon Nov  7 13:38:34 2011
New Revision: 144000

URL: http://llvm.org/viewvc/llvm-project?rev=144000&view=rev
Log:
Make sure we don't insert instructions before a landingpad instruction.
<rdar://problem/10405911>

Modified:
    llvm/trunk/lib/Transforms/Utils/DemoteRegToStack.cpp

Modified: llvm/trunk/lib/Transforms/Utils/DemoteRegToStack.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/DemoteRegToStack.cpp?rev=144000&r1=143999&r2=144000&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Utils/DemoteRegToStack.cpp (original)
+++ llvm/trunk/lib/Transforms/Utils/DemoteRegToStack.cpp Mon Nov  7 13:38:34 2011
@@ -97,8 +97,8 @@
     InsertPt = II.getNormalDest()->begin();
   }
 
-  for (; isa<PHINode>(InsertPt); ++InsertPt)
-  /* empty */;   // Don't insert before any PHI nodes.
+  for (; isa<PHINode>(InsertPt) || isa<LandingPadInst>(InsertPt); ++InsertPt)
+  /* empty */;   // Don't insert before any PHI nodes or landingpad instrs.
   new StoreInst(&I, Slot, InsertPt);
 
   return Slot;





More information about the llvm-commits mailing list