Fixing a problem with insert location in WinEH outlining
authorAndrew Kaylor <andrew.kaylor@intel.com>
Wed, 25 Feb 2015 20:12:49 +0000 (20:12 +0000)
committerAndrew Kaylor <andrew.kaylor@intel.com>
Wed, 25 Feb 2015 20:12:49 +0000 (20:12 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230535 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/WinEHPrepare.cpp

index 1d5206c6cadff95b5a4d746a2d43b221b354131d..6f712a914f98cd37f017a263cf51ec64f0acae80 100644 (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();