[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)
commit39789f81ab330a5582919b2edb592d2a63f6c663
tree2e55bed213261fd37c8b126148d88fd0aca73adb
parent9cd7a4b72d2844550108d3da0b94b525428124fa
[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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235768 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/CodeGen/FunctionLoweringInfo.h
include/llvm/IR/Intrinsics.td
lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp
lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
lib/CodeGen/WinEHPrepare.cpp
test/CodeGen/WinEH/seh-resume-phi.ll
test/CodeGen/X86/seh-catch-all.ll