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

<rdar://problem/10405911>


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@144000 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Bill Wendling 2011-11-07 19:38:34 +00:00
parent 3e5d5c53a0
commit ac101e5848

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;