Please use GitHub pull requests for new patches. Avoid migrating existing patches. Phabricator shutdown timeline
Changeset View
Changeset View
Standalone View
Standalone View
clang/lib/CodeGen/CGCleanup.h
Show First 20 Lines • Show All 587 Lines • ▼ Show 20 Lines | |||||
struct EHPersonality { | struct EHPersonality { | ||||
const char *PersonalityFn; | const char *PersonalityFn; | ||||
// If this is non-null, this personality requires a non-standard | // If this is non-null, this personality requires a non-standard | ||||
// function for rethrowing an exception after a catchall cleanup. | // function for rethrowing an exception after a catchall cleanup. | ||||
// This function must have prototype void(void*). | // This function must have prototype void(void*). | ||||
const char *CatchallRethrowFn; | const char *CatchallRethrowFn; | ||||
static const EHPersonality &get(CodeGenModule &CGM, const FunctionDecl *FD); | static const EHPersonality &get(const CodeGenModule &CGM, | ||||
static const EHPersonality &get(CodeGenFunction &CGF); | const FunctionDecl *FD); | ||||
static const EHPersonality &get(const CodeGenFunction &CGF); | |||||
static const EHPersonality GNU_C; | static const EHPersonality GNU_C; | ||||
static const EHPersonality GNU_C_SJLJ; | static const EHPersonality GNU_C_SJLJ; | ||||
static const EHPersonality GNU_C_SEH; | static const EHPersonality GNU_C_SEH; | ||||
static const EHPersonality GNU_ObjC; | static const EHPersonality GNU_ObjC; | ||||
static const EHPersonality GNU_ObjC_SJLJ; | static const EHPersonality GNU_ObjC_SJLJ; | ||||
static const EHPersonality GNU_ObjC_SEH; | static const EHPersonality GNU_ObjC_SEH; | ||||
static const EHPersonality GNUstep_ObjC; | static const EHPersonality GNUstep_ObjC; | ||||
Show All 17 Lines | struct EHPersonality { | ||||
bool isMSVCPersonality() const { | bool isMSVCPersonality() const { | ||||
return this == &MSVC_except_handler || this == &MSVC_C_specific_handler || | return this == &MSVC_except_handler || this == &MSVC_C_specific_handler || | ||||
this == &MSVC_CxxFrameHandler3; | this == &MSVC_CxxFrameHandler3; | ||||
} | } | ||||
bool isWasmPersonality() const { return this == &GNU_Wasm_CPlusPlus; } | bool isWasmPersonality() const { return this == &GNU_Wasm_CPlusPlus; } | ||||
bool isMSVCXXPersonality() const { return this == &MSVC_CxxFrameHandler3; } | bool isMSVCXXPersonality() const { return this == &MSVC_CxxFrameHandler3; } | ||||
// Does the personality function cause std::terminate() to be called properly, | |||||
// if an unwindabort call unwinds? This is generally true for C++ | |||||
// personalities, but so far only tested on a few, so only enable it for | |||||
// those. | |||||
// | |||||
// TODO: determine which of the other personalities also support this | |||||
// behavior. MSVC unwind support will take more implementation work in LLVM, | |||||
// but should be possible to make work. | |||||
bool supportsUnwindAbort() const { | |||||
return this == &GNU_CPlusPlus || this == &NeXT_ObjC; | |||||
} | |||||
}; | }; | ||||
} | } | ||||
} | } | ||||
#endif | #endif |