[SEH] Implement GetExceptionCode in __except blocks
authorReid Kleckner <reid@kleckner.net>
Fri, 24 Apr 2015 20:25:05 +0000 (20:25 +0000)
committerReid Kleckner <reid@kleckner.net>
Fri, 24 Apr 2015 20:25:05 +0000 (20:25 +0000)
commitcfbfe6f29cb9f66766fe0851062ca239a8299acb
tree922f845d30fba8d4a7d427478bbe7e37d37ecc5b
parent75ef0c09d0b5c3f9b6ee9e1dc1874b9d0001e8a4
[SEH] Implement GetExceptionCode in __except blocks

This introduces an intrinsic called llvm.eh.exceptioncode. It is lowered
by copying the EAX value live into whatever basic block it is called
from. Obviously, this only works if you insert it late during codegen,
because otherwise mid-level passes might reschedule it.

llvm-svn: 235768
llvm/include/llvm/CodeGen/FunctionLoweringInfo.h
llvm/include/llvm/IR/Intrinsics.td
llvm/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp
llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
llvm/lib/CodeGen/WinEHPrepare.cpp
llvm/test/CodeGen/WinEH/seh-resume-phi.ll
llvm/test/CodeGen/X86/seh-catch-all.ll