summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/PrologEpilogInserter.cpp
diff options
context:
space:
mode:
authorReid Kleckner <rnk@google.com>2015-10-07 21:13:15 +0000
committerReid Kleckner <rnk@google.com>2015-10-07 21:13:15 +0000
commit70bf6bb5e6b8e3ddde3245d36cf7f84d05297fd5 (patch)
tree8d698df9d497267a261ff9996f33ce3259a202f2 /llvm/lib/CodeGen/PrologEpilogInserter.cpp
parentc289c9ff553424791d9b72b6eb5529f9f14e58d9 (diff)
downloadbcm5719-llvm-70bf6bb5e6b8e3ddde3245d36cf7f84d05297fd5.tar.gz
bcm5719-llvm-70bf6bb5e6b8e3ddde3245d36cf7f84d05297fd5.zip
[WinEH] Undo the effect of r249578 for 32-bit
The __CxxFrameHandler3 tables for 32-bit are supposed to hold stack offsets relative to EBP, not ESP. I blindly updated the win-catchpad.ll test case, and immediately noticed that 32-bit catching stopped working. While I'm at it, move the frame index to frame offset WinEH table logic out of PEI. PEI shouldn't have to know about WinEHFuncInfo. I realized we can calculate frame index offsets just fine from the table printer. llvm-svn: 249618
Diffstat (limited to 'llvm/lib/CodeGen/PrologEpilogInserter.cpp')
-rw-r--r--llvm/lib/CodeGen/PrologEpilogInserter.cpp22
1 files changed, 0 insertions, 22 deletions
diff --git a/llvm/lib/CodeGen/PrologEpilogInserter.cpp b/llvm/lib/CodeGen/PrologEpilogInserter.cpp
index 495da5c07d1..fab56bcfe85 100644
--- a/llvm/lib/CodeGen/PrologEpilogInserter.cpp
+++ b/llvm/lib/CodeGen/PrologEpilogInserter.cpp
@@ -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());
OpenPOWER on IntegriCloud