Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-05-10 08:57:06

0001 //===----------------------------------------------------------------------===//
0002 //
0003 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
0004 // See https://llvm.org/LICENSE.txt for license information.
0005 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
0006 //
0007 //
0008 // C++ ABI Level 1 ABI documented at:
0009 //   https://itanium-cxx-abi.github.io/cxx-abi/abi-eh.html
0010 //
0011 //===----------------------------------------------------------------------===//
0012 
0013 #ifndef __ITANIUM_UNWIND_H__
0014 #define __ITANIUM_UNWIND_H__
0015 
0016 struct _Unwind_Context;   // opaque
0017 struct _Unwind_Exception; // forward declaration
0018 typedef struct _Unwind_Exception _Unwind_Exception;
0019 typedef uint64_t _Unwind_Exception_Class;
0020 
0021 struct _Unwind_Exception {
0022   _Unwind_Exception_Class exception_class;
0023   void (*exception_cleanup)(_Unwind_Reason_Code reason,
0024                             _Unwind_Exception *exc);
0025 #if defined(__SEH__) && !defined(__USING_SJLJ_EXCEPTIONS__)
0026   uintptr_t private_[6];
0027 #else
0028   uintptr_t private_1; // non-zero means forced unwind
0029   uintptr_t private_2; // holds sp that phase1 found for phase2 to use
0030 #endif
0031 #if __SIZEOF_POINTER__ == 4
0032   // The implementation of _Unwind_Exception uses an attribute mode on the
0033   // above fields which has the side effect of causing this whole struct to
0034   // round up to 32 bytes in size (48 with SEH). To be more explicit, we add
0035   // pad fields added for binary compatibility.
0036   uint32_t reserved[3];
0037 #endif
0038   // The Itanium ABI requires that _Unwind_Exception objects are "double-word
0039   // aligned".  GCC has interpreted this to mean "use the maximum useful
0040   // alignment for the target"; so do we.
0041 } __attribute__((__aligned__));
0042 
0043 typedef _Unwind_Reason_Code (*_Unwind_Personality_Fn)(
0044     int version, _Unwind_Action actions, uint64_t exceptionClass,
0045     _Unwind_Exception *exceptionObject, struct _Unwind_Context *context);
0046 
0047 #ifdef __cplusplus
0048 extern "C" {
0049 #endif
0050 
0051 //
0052 // The following are the base functions documented by the C++ ABI
0053 //
0054 #ifdef __USING_SJLJ_EXCEPTIONS__
0055 extern _Unwind_Reason_Code
0056     _Unwind_SjLj_RaiseException(_Unwind_Exception *exception_object);
0057 extern void _Unwind_SjLj_Resume(_Unwind_Exception *exception_object);
0058 #else
0059 extern _Unwind_Reason_Code
0060     _Unwind_RaiseException(_Unwind_Exception *exception_object);
0061 extern void _Unwind_Resume(_Unwind_Exception *exception_object);
0062 #endif
0063 extern void _Unwind_DeleteException(_Unwind_Exception *exception_object);
0064 
0065 
0066 extern uintptr_t _Unwind_GetGR(struct _Unwind_Context *context, int index);
0067 extern void _Unwind_SetGR(struct _Unwind_Context *context, int index,
0068                           uintptr_t new_value);
0069 extern uintptr_t _Unwind_GetIP(struct _Unwind_Context *context);
0070 extern void _Unwind_SetIP(struct _Unwind_Context *, uintptr_t new_value);
0071 
0072 #ifdef __cplusplus
0073 }
0074 #endif
0075 
0076 #endif // __ITANIUM_UNWIND_H__