[WinEHPrepare] Add rudimentary support for the new EH instructions
[oota-llvm.git] / lib / Transforms / Utils / DemoteRegToStack.cpp
index f11b6099939cb8ac3492135ab35cf634d674ca7c..1d7c740b6e0f74d2f7d71ee2e1630ff2026e1259 100644 (file)
@@ -135,7 +135,7 @@ AllocaInst *llvm::DemotePHIToStack(PHINode *P, Instruction *AllocaPoint) {
   // Insert a load in place of the PHI and replace all uses.
   BasicBlock::iterator InsertPt = P;
 
-  for (; isa<PHINode>(InsertPt) || isa<LandingPadInst>(InsertPt); ++InsertPt)
+  for (; isa<PHINode>(InsertPt) || InsertPt->isEHPad(); ++InsertPt)
     /* empty */;   // Don't insert before PHI nodes or landingpad instrs.
 
   Value *V = new LoadInst(Slot, P->getName()+".reload", InsertPt);