[WinEH] Undo the effect of r249578 for 32-bit
[oota-llvm.git] / lib / CodeGen / PrologEpilogInserter.cpp
index 495da5c07d11e91ee05ba9609fdf19d6c93ca0cd..fab56bcfe85c9f81c06984c50cf3ffff46c753b7 100644 (file)
@@ -807,28 +807,6 @@ void PEI::replaceFrameIndices(MachineFunction &Fn) {
   const TargetFrameLowering &TFI = *Fn.getSubtarget().getFrameLowering();
   if (!TFI.needsFrameIndexResolution(Fn)) return;
 
-  MachineModuleInfo &MMI = Fn.getMMI();
-  const Function *F = Fn.getFunction();
-  const Function *ParentF = MMI.getWinEHParent(F);
-  unsigned FrameReg;
-  if (F == ParentF) {
-    WinEHFuncInfo &FuncInfo = MMI.getWinEHFuncInfo(Fn.getFunction());
-    // FIXME: This should be unconditional but we have bugs in the preparation
-    // pass.
-    if (FuncInfo.UnwindHelpFrameIdx != INT_MAX)
-      FuncInfo.UnwindHelpFrameOffset = TFI.getFrameIndexReferenceFromSP(
-          Fn, FuncInfo.UnwindHelpFrameIdx, FrameReg);
-    for (WinEHTryBlockMapEntry &TBME : FuncInfo.TryBlockMap) {
-      for (WinEHHandlerType &H : TBME.HandlerArray) {
-        if (H.CatchObj.FrameIndex == INT_MAX)
-          H.CatchObj.FrameOffset = INT_MAX;
-        else
-          H.CatchObj.FrameOffset = TFI.getFrameIndexReferenceFromSP(
-              Fn, H.CatchObj.FrameIndex, FrameReg);
-      }
-    }
-  }
-
   // Store SPAdj at exit of a basic block.
   SmallVector<int, 8> SPState;
   SPState.resize(Fn.getNumBlockIDs());