[WinEH] Minor bug fixes.

Fixed insert point for allocas created for demoted values.
Clear the nested landing pad list after it has been processed.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234433 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Andrew Kaylor
2015-04-08 20:57:22 +00:00
parent 522877813a
commit a9180a2fac
2 changed files with 5 additions and 4 deletions

View File

@ -499,6 +499,7 @@ bool WinEHPrepare::prepareExceptionHandlers(
// cleans up references to outlined blocks that will be deleted.
for (auto &LPadPair : NestedLPtoOriginalLP)
completeNestedLandingPad(&F, LPadPair.first, LPadPair.second, FrameVarInfo);
NestedLPtoOriginalLP.clear();
F.addFnAttr("wineh-parent", F.getName());
@ -554,10 +555,10 @@ bool WinEHPrepare::prepareExceptionHandlers(
++InsertPt;
ParentAlloca =
new AllocaInst(ParentInst->getType(), nullptr,
ParentInst->getName() + ".reg2mem", InsertPt);
ParentInst->getName() + ".reg2mem", AllocaInsertPt);
new StoreInst(ParentInst, ParentAlloca, InsertPt);
} else {
ParentAlloca = DemoteRegToStack(*ParentInst, true, ParentInst);
ParentAlloca = DemoteRegToStack(*ParentInst, true, AllocaInsertPt);
}
}
}