diff options
author | Reid Kleckner <rnk@google.com> | 2015-09-08 22:44:41 +0000 |
---|---|---|
committer | Reid Kleckner <rnk@google.com> | 2015-09-08 22:44:41 +0000 |
commit | df1295173f244ce9d1c67ced33e05ba00042308d (patch) | |
tree | b124401bb445e92c27bf597157be919fc293bfc1 /llvm/lib/CodeGen/SelectionDAG | |
parent | 18203f763ccf8863f49cfc40f08253a7764ef657 (diff) | |
download | bcm5719-llvm-df1295173f244ce9d1c67ced33e05ba00042308d.tar.gz bcm5719-llvm-df1295173f244ce9d1c67ced33e05ba00042308d.zip |
[WinEH] Emit prologues and epilogues for funclets
Summary:
32-bit funclets have short prologues that allocate enough stack for the
largest call in the whole function. The runtime saves CSRs for the
funclet. It doesn't restore CSRs after we finally transfer control back
to the parent funciton via a CATCHRET, but that's a separate issue.
32-bit funclets also have to adjust the incoming EBP value, which is
what llvm.x86.seh.recoverframe does in the old model.
64-bit funclets need to spill CSRs as normal. For simplicity, this just
spills the same set of CSRs as the parent function, rather than trying
to compute different CSR sets for the parent function and each funclet.
64-bit funclets also allocate enough stack space for the largest
outgoing call frame, like 32-bit.
Reviewers: majnemer
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D12546
llvm-svn: 247092
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG')
-rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp b/llvm/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp index 7a45858885d..3a51676bc9a 100644 --- a/llvm/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp @@ -280,6 +280,12 @@ void FunctionLoweringInfo::set(const Function &fn, MachineFunction &mf, for (WinEHHandlerType &H : TBME.HandlerArray) if (const auto *BB = dyn_cast<BasicBlock>(H.Handler)) H.HandlerMBB = MBBMap[BB]; + // If there's an explicit EH registration node on the stack, record its + // frame index. + if (EHInfo.EHRegNode && EHInfo.EHRegNode->getParent()->getParent() == Fn) { + assert(StaticAllocaMap.count(EHInfo.EHRegNode)); + EHInfo.EHRegNodeFrameIndex = StaticAllocaMap[EHInfo.EHRegNode]; + } } // Copy the state numbers to LandingPadInfo for the current function, which |