- 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);
- } else if (MMI.hasWinEHFuncInfo(F)) {
- WinEHFuncInfo &FuncInfo = MMI.getWinEHFuncInfo(Fn.getFunction());
- auto I = FuncInfo.CatchHandlerParentFrameObjIdx.find(F);
- if (I != FuncInfo.CatchHandlerParentFrameObjIdx.end())
- FuncInfo.CatchHandlerParentFrameObjOffset[F] =
- TFI.getFrameIndexReferenceFromSP(Fn, I->second, FrameReg);
- }
-