[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)
commitbcda1cd45ab48afa20add7b54fe704bef24bde68
treecfe14de38ac1daa31f2973be92d2f926479c9ebb
parent04b0e92766a6224dc877ae7b936a07cbf11983a2
[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

llvm-svn: 236172
llvm/lib/Analysis/LibCallSemantics.cpp
llvm/lib/CodeGen/WinEHPrepare.cpp
llvm/test/CodeGen/WinEH/cppeh-demote-liveout.ll
llvm/test/CodeGen/WinEH/cppeh-inalloca.ll
llvm/test/CodeGen/WinEH/seh-simple.ll