From: Andrew Kaylor Date: Wed, 25 Feb 2015 20:12:49 +0000 (+0000) Subject: Fixing a problem with insert location in WinEH outlining X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=88c74bffbff520d8be55875cf0bbbb8899a8933a;p=oota-llvm.git 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 --- diff --git a/lib/CodeGen/WinEHPrepare.cpp b/lib/CodeGen/WinEHPrepare.cpp index 1d5206c6cad..6f712a914f9 100644 --- a/lib/CodeGen/WinEHPrepare.cpp +++ b/lib/CodeGen/WinEHPrepare.cpp @@ -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();