[WinEH] Replace more lpad value uses with undef
authorReid Kleckner <reid@kleckner.net>
Thu, 23 Apr 2015 21:22:30 +0000 (21:22 +0000)
committerReid Kleckner <reid@kleckner.net>
Thu, 23 Apr 2015 21:22:30 +0000 (21:22 +0000)
commitd1807ff318abd0edb1079013b9856e33f690d781
tree1f9cca544c7cf737547bd3a6c48f15feb2a33bdc
parentc364314ec3143d8c323e006ea588168a3b3516d5
[WinEH] Replace more lpad value uses with undef

We were asserting on code like this:
  extern "C" unsigned long _exception_code();
  void might_crash(unsigned long);
  void foo() {
    __try {
      might_crash(0);
    } __except(1) {
      might_crash(_exception_code());
    }
  }

Gtest and many other libraries get the exception code from the __except
block. What's supposed to happen here is that EAX is live into the
__except block, and it contains the exception code. Eventually we'll
represent that as a use of the landingpad ehptr value, but for now we
can replace it with undef.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235649 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/WinEHPrepare.cpp
test/CodeGen/WinEH/seh-resume-phi.ll [new file with mode: 0644]