Fixing a problem with insert location in WinEH outlining

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230535 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Andrew Kaylor 2015-02-25 20:12:49 +00:00
parent a0a0b40aa3
commit 88c74bffbf

View File

@ -320,6 +320,7 @@ bool WinEHPrepare::prepareCPPEHHandlers(
// that pull the EHObjPtr from the frame alloc structure
for (AllocaInst *EHObjPtr : HandlerEHObjPtrs) {
Value *EHData = EHDataMap[EHObjPtr->getParent()->getParent()];
Builder.SetInsertPoint(EHObjPtr);
Value *ElementPtr = Builder.CreateConstInBoundsGEP2_32(EHData, 0, 1);
EHObjPtr->replaceAllUsesWith(ElementPtr);
EHObjPtr->removeFromParent();