[WinEH] Start EH preparation for 32-bit x86, it uses no arguments
authorReid Kleckner <reid@kleckner.net>
Wed, 29 Apr 2015 22:49:54 +0000 (22:49 +0000)
committerReid Kleckner <reid@kleckner.net>
Wed, 29 Apr 2015 22:49:54 +0000 (22:49 +0000)
commit85b9ebb7e8115403754c053517a95ba23ff58c5b
tree58e1883ae36766042424233391829ce82241355b
parent3c2da524a63b31f3a9cf9f9219fb18c7ffb7c6f9
[WinEH] Start EH preparation for 32-bit x86, it uses no arguments

32-bit x86 MSVC-style exceptions are functionaly similar to 64-bit, but
they take no arguments. Instead, they implicitly use the value of EBP
passed in by the caller as a pointer to the parent's frame. In LLVM, we
can represent this as llvm.frameaddress(1), and feed that into all of
our calls to llvm.framerecover.

The next steps are:
- Add an alloca to the fs:00 linked list of handlers
- Add something like llvm.sjlj.lsda or generalize it to store in the
  alloca
- Move state number calculation to WinEHPrepare, arrange for
  FunctionLoweringInfo to call it
- Use the state numbers to insert explicit loads and stores in the IR

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@236172 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Analysis/LibCallSemantics.cpp
lib/CodeGen/WinEHPrepare.cpp
test/CodeGen/WinEH/cppeh-demote-liveout.ll
test/CodeGen/WinEH/cppeh-inalloca.ll
test/CodeGen/WinEH/seh-simple.ll