Handle PHI nodes prefacing EH pads too
llvm-svn: 244274
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user