mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-11-26 07:18:15 +00:00
[WinEH] Create an llvm.x86.seh.exceptioninfo intrinsic
This intrinsic is like framerecover plus a load. It recovers the EH registration stack allocation from the parent frame and loads the exception information field out of it, giving back a pointer to an EXCEPTION_POINTERS struct. It's designed for clang to use in SEH filter expressions instead of accessing the EXCEPTION_POINTERS parameter that is available on x64. This required a minor change to MC to allow defining a label variable to another absolute framerecover label variable. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239567 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -144,14 +144,15 @@ struct WinEHFuncInfo {
|
||||
SmallVector<WinEHUnwindMapEntry, 4> UnwindMap;
|
||||
SmallVector<WinEHTryBlockMapEntry, 4> TryBlockMap;
|
||||
SmallVector<std::pair<MCSymbol *, int>, 4> IPToStateList;
|
||||
int UnwindHelpFrameIdx;
|
||||
int UnwindHelpFrameOffset;
|
||||
int UnwindHelpFrameIdx = INT_MAX;
|
||||
int UnwindHelpFrameOffset = -1;
|
||||
unsigned NumIPToStateFuncsVisited = 0;
|
||||
|
||||
unsigned NumIPToStateFuncsVisited;
|
||||
/// frameescape index of the 32-bit EH registration node. Set by
|
||||
/// WinEHStatePass and used indirectly by SEH filter functions of the parent.
|
||||
int EHRegNodeEscapeIndex = INT_MAX;
|
||||
|
||||
WinEHFuncInfo()
|
||||
: UnwindHelpFrameIdx(INT_MAX), UnwindHelpFrameOffset(-1),
|
||||
NumIPToStateFuncsVisited(0) {}
|
||||
WinEHFuncInfo() {}
|
||||
};
|
||||
|
||||
/// Analyze the IR in ParentFn and it's handlers to build WinEHFuncInfo, which
|
||||
|
||||
@@ -429,7 +429,6 @@ def int_eh_endcatch : Intrinsic<[], []>;
|
||||
def int_eh_actions : Intrinsic<[llvm_ptr_ty], [llvm_vararg_ty], []>;
|
||||
|
||||
def int_eh_exceptioncode : Intrinsic<[llvm_i32_ty], [], [IntrReadMem]>;
|
||||
def int_eh_exceptioninfo : Intrinsic<[llvm_ptr_ty], [], [IntrReadMem]>;
|
||||
|
||||
// __builtin_unwind_init is an undocumented GCC intrinsic that causes all
|
||||
// callee-saved registers to be saved and restored (regardless of whether they
|
||||
|
||||
@@ -18,9 +18,12 @@ let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.".
|
||||
}
|
||||
|
||||
//===----------------------------------------------------------------------===//
|
||||
// SEH LSDA for Windows
|
||||
// SEH intrinsics for Windows
|
||||
let TargetPrefix = "x86" in {
|
||||
def int_x86_seh_lsda : Intrinsic<[llvm_ptr_ty], [llvm_ptr_ty], [IntrNoMem]>;
|
||||
def int_x86_seh_exceptioninfo : Intrinsic<[llvm_ptr_ty],
|
||||
[llvm_ptr_ty, llvm_ptr_ty],
|
||||
[IntrReadMem]>;
|
||||
}
|
||||
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
Reference in New Issue
Block a user