[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)
commite3af86e9d9c348744aec98f6180f4260455954ad
tree723ffeb851e56753fafb238a9251b4cd44f4b3e8
parentde71142dcef3414043f03364e451adbd68d03f0e
[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.

llvm-svn: 235649
llvm/lib/CodeGen/WinEHPrepare.cpp
llvm/test/CodeGen/WinEH/seh-resume-phi.ll [new file with mode: 0644]