[WinEH] Generate .xdata for catch handlers
[oota-llvm.git] / lib / CodeGen / WinEHPrepare.cpp
index 94e046c424da91664c7b1d833a12c9dcb2bda99f..5b4ee17d9491ea4e91c4be05755122efa8db3441 100644 (file)
@@ -638,16 +638,6 @@ bool WinEHPrepare::outlineHandler(ActionHandler *Action, Function *SrcFn,
   if (!LPadMap.isInitialized())
     LPadMap.mapLandingPad(LPad);
   if (auto *CatchAction = dyn_cast<CatchHandler>(Action)) {
-    // Insert an alloca for the object which holds the address of the parent's
-    // frame pointer.  The stack offset of this object needs to be encoded in
-    // xdata.
-    AllocaInst *ParentFrame = new AllocaInst(Int8PtrType, "parentframe", Entry);
-    Builder.CreateStore(&Handler->getArgumentList().back(), ParentFrame,
-                        /*isStore=*/true);
-    Function *ParentFrameFn =
-        Intrinsic::getDeclaration(M, Intrinsic::eh_parentframe);
-    Builder.CreateCall(ParentFrameFn, ParentFrame);
-
     Constant *Sel = CatchAction->getSelector();
     Director.reset(new WinEHCatchDirector(Handler, Sel, VarInfo, LPadMap));
     LPadMap.remapSelector(VMap, ConstantInt::get(Type::getInt32Ty(Context), 1));