[WinEH] Emit prologues and epilogues for funclets
authorReid Kleckner <rnk@google.com>
Tue, 8 Sep 2015 22:44:41 +0000 (22:44 +0000)
committerReid Kleckner <rnk@google.com>
Tue, 8 Sep 2015 22:44:41 +0000 (22:44 +0000)
commitdff75493e8040cefd56c9b984e6af5b60c32ec45
treefe5fae2a410e6dcfa94103904cf79f2c57db119d
parent938e129fc2ea7820fd3e7e6a9fd1ed5f02e79820
[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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247092 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/CodeGen/WinEHFuncInfo.h
lib/CodeGen/AsmPrinter/WinException.cpp
lib/CodeGen/PrologEpilogInserter.cpp
lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp
lib/Target/X86/X86FrameLowering.cpp
lib/Target/X86/X86FrameLowering.h
lib/Target/X86/X86InstrCompiler.td
lib/Target/X86/X86MCInstLower.cpp
lib/Target/X86/X86WinEHState.cpp
test/CodeGen/X86/win-catchpad-csrs.ll [new file with mode: 0644]
test/CodeGen/X86/win-catchpad.ll