Make sure we don't insert instructions before a landingpad instruction.

<rdar://problem/10405911>

llvm-svn: 144000
This commit is contained in:
Bill Wendling 2011-11-07 19:38:34 +00:00
parent 09d3af4c2b
commit 7496461f44
1 changed files with 2 additions and 2 deletions

View File

@ -97,8 +97,8 @@ AllocaInst* llvm::DemoteRegToStack(Instruction &I, bool VolatileLoads,
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;