Fixing a problem with insert location in WinEH outlining

llvm-svn: 230535
This commit is contained in:
Andrew Kaylor 2015-02-25 20:12:49 +00:00
parent 443aa4b4b0
commit b59b80b956
1 changed files with 1 additions and 0 deletions

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();