[WinEH] Add an EH registration and state insertion pass for 32-bit x86
authorReid Kleckner <reid@kleckner.net>
Fri, 1 May 2015 20:04:54 +0000 (20:04 +0000)
committerReid Kleckner <reid@kleckner.net>
Fri, 1 May 2015 20:04:54 +0000 (20:04 +0000)
commit018ed7b68b12e74a655a6ef00179455eda6e6e88
tree9f16e5e2a1af88ca5fa39e74cb62c87c6efd248e
parent930e05eaefb3ac8275973329bd55b05c4ce8e14c
[WinEH] Add an EH registration and state insertion pass for 32-bit x86

This pass is responsible for constructing the EH registration object
that gets linked into fs:00, which is all it does in this change. In the
future, it will also insert stores to update the EH state number.

I considered keeping this functionality in WinEHPrepare, but it's pretty
separable and X86 specific. It has conceptually very little to do with
the task of WinEHPrepare, which is currently outlining.  WinEHPrepare is
also in theory useful on ARM, but this logic is pretty x86 specific.

Reviewers: andrew.w.kaylor, majnemer

Differential Revision: http://reviews.llvm.org/D9422

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@236339 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/MC/MCAsmInfo.h
lib/CodeGen/AsmPrinter/AsmPrinter.cpp
lib/CodeGen/WinEHPrepare.cpp
lib/Target/X86/CMakeLists.txt
lib/Target/X86/MCTargetDesc/X86MCAsmInfo.cpp
lib/Target/X86/X86.h
lib/Target/X86/X86TargetMachine.cpp
lib/Target/X86/X86WinEHState.cpp [new file with mode: 0644]
test/CodeGen/X86/inalloca-invoke.ll
test/CodeGen/X86/win32-eh.ll [new file with mode: 0644]