forked from OSchip/llvm-project
[libc++abi][AIX] Use _LIBCXXABI_FUNC_VIS for exported routines
Summary: This patch adds _LIBCXXABI_FUNC_VIS to the definitions of the personality and helper routines for the state table based EH, now that the support of the visibility attribute is being added to AIX Clang. Currently an export list is generated in the absence of the visibility attribute support downstream. Reviewed by: MaskRay, daltenty Differential Revision: https://reviews.llvm.org/D126915
This commit is contained in:
parent
07f21021e7
commit
8da2009608
|
@ -538,7 +538,8 @@ static void scan_state_tab(scan_results& results, _Unwind_Action actions, bool n
|
||||||
}
|
}
|
||||||
|
|
||||||
// Personality routine for EH using the state table.
|
// Personality routine for EH using the state table.
|
||||||
_Unwind_Reason_Code __xlcxx_personality_v0(int version, _Unwind_Action actions, uint64_t exceptionClass,
|
_LIBCXXABI_FUNC_VIS _Unwind_Reason_Code
|
||||||
|
__xlcxx_personality_v0(int version, _Unwind_Action actions, uint64_t exceptionClass,
|
||||||
_Unwind_Exception* unwind_exception, _Unwind_Context* context) {
|
_Unwind_Exception* unwind_exception, _Unwind_Context* context) {
|
||||||
if (version != 1 || unwind_exception == 0 || context == 0)
|
if (version != 1 || unwind_exception == 0 || context == 0)
|
||||||
return _URC_FATAL_PHASE1_ERROR;
|
return _URC_FATAL_PHASE1_ERROR;
|
||||||
|
@ -574,7 +575,8 @@ _Unwind_Reason_Code __xlcxx_personality_v0(int version, _Unwind_Action actions,
|
||||||
// Check whether the thrown object matches the catch handler's exception
|
// Check whether the thrown object matches the catch handler's exception
|
||||||
// declaration. If there is a match, the function returns true with adjusted
|
// declaration. If there is a match, the function returns true with adjusted
|
||||||
// address of the thrown object. Otherwise, returns false.
|
// address of the thrown object. Otherwise, returns false.
|
||||||
bool __xlc_catch_matchv2(_Unwind_Exception* exceptionObject, std::type_info* catchTypeInfo, void*& obj) {
|
_LIBCXXABI_FUNC_VIS bool
|
||||||
|
__xlc_catch_matchv2(_Unwind_Exception* exceptionObject, std::type_info* catchTypeInfo, void*& obj) {
|
||||||
_LIBCXXABI_TRACE_STATETAB("Entering %s, exceptionObject=%p\n", __func__, reinterpret_cast<void*>(exceptionObject));
|
_LIBCXXABI_TRACE_STATETAB("Entering %s, exceptionObject=%p\n", __func__, reinterpret_cast<void*>(exceptionObject));
|
||||||
|
|
||||||
if (!__isOurExceptionClass(exceptionObject)) {
|
if (!__isOurExceptionClass(exceptionObject)) {
|
||||||
|
@ -625,7 +627,7 @@ bool __xlc_catch_matchv2(_Unwind_Exception* exceptionObject, std::type_info* cat
|
||||||
// During unwinding for this bad_exception, the previous exception which is
|
// During unwinding for this bad_exception, the previous exception which is
|
||||||
// not matching the throw spec will be cleaned up. Thus having the same
|
// not matching the throw spec will be cleaned up. Thus having the same
|
||||||
// effect as replace the top most exception (which is bad) with a bad_exception.
|
// effect as replace the top most exception (which is bad) with a bad_exception.
|
||||||
void __xlc_throw_badexception() {
|
_LIBCXXABI_FUNC_VIS void __xlc_throw_badexception() {
|
||||||
_LIBCXXABI_TRACE_STATETAB("Entering function: %s\n\n", __func__);
|
_LIBCXXABI_TRACE_STATETAB("Entering function: %s\n\n", __func__);
|
||||||
void* newexception = new (__cxa_allocate_exception(sizeof(std::bad_exception))) std::bad_exception;
|
void* newexception = new (__cxa_allocate_exception(sizeof(std::bad_exception))) std::bad_exception;
|
||||||
__cxa_throw(newexception, const_cast<std::type_info*>(&typeid(std::bad_exception)), 0);
|
__cxa_throw(newexception, const_cast<std::type_info*>(&typeid(std::bad_exception)), 0);
|
||||||
|
@ -634,20 +636,21 @@ void __xlc_throw_badexception() {
|
||||||
// __xlc_exception_handle
|
// __xlc_exception_handle
|
||||||
// This function is for xlclang++. It returns the address of the exception
|
// This function is for xlclang++. It returns the address of the exception
|
||||||
// object set in gpr14 by the personality routine for xlclang++ compiled code.
|
// object set in gpr14 by the personality routine for xlclang++ compiled code.
|
||||||
uintptr_t __xlc_exception_handle() {
|
_LIBCXXABI_FUNC_VIS uintptr_t __xlc_exception_handle() {
|
||||||
uintptr_t exceptionObject;
|
uintptr_t exceptionObject;
|
||||||
asm("mr %0, 14" : "=r"(exceptionObject));
|
asm("mr %0, 14" : "=r"(exceptionObject));
|
||||||
return exceptionObject;
|
return exceptionObject;
|
||||||
}
|
}
|
||||||
|
|
||||||
// xlclang++ may generate calls to __Deleted_Virtual.
|
// xlclang++ may generate calls to __Deleted_Virtual.
|
||||||
void __Deleted_Virtual() { abort(); }
|
_LIBCXXABI_FUNC_VIS void __Deleted_Virtual() { abort(); }
|
||||||
|
|
||||||
// __catchThrownException is called during AIX library initialization and
|
// __catchThrownException is called during AIX library initialization and
|
||||||
// termination to handle exceptions. An implementation is also provided in
|
// termination to handle exceptions. An implementation is also provided in
|
||||||
// libC.a(shrcore.o). This implementation is provided for applications that
|
// libC.a(shrcore.o). This implementation is provided for applications that
|
||||||
// link with -lc++ (the xlclang++ or ibm-clang++ link default.)
|
// link with -lc++ (the xlclang++ or ibm-clang++ link default.)
|
||||||
int __catchThrownException(void (*cdfunc)(void), // function which may fail
|
_LIBCXXABI_FUNC_VIS int
|
||||||
|
__catchThrownException(void (*cdfunc)(void), // function which may fail
|
||||||
void (*cleanup)(void*), // cleanup function
|
void (*cleanup)(void*), // cleanup function
|
||||||
void* cleanuparg, // parameter to cleanup function
|
void* cleanuparg, // parameter to cleanup function
|
||||||
int action) { // control exception throwing and termination
|
int action) { // control exception throwing and termination
|
||||||
|
|
Loading…
Reference in New Issue