1 //===----------------------------------------------------------------------===//
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
8 // This file implements the functionality associated with the terminate_handler,
9 // unexpected_handler, and new_handler.
10 //===----------------------------------------------------------------------===//
12 #ifndef _CXA_HANDLERS_H
13 #define _CXA_HANDLERS_H
15 #include "__cxxabi_config.h"
22 _LIBCXXABI_HIDDEN _LIBCXXABI_NORETURN
24 __unexpected(unexpected_handler func
);
26 _LIBCXXABI_HIDDEN _LIBCXXABI_NORETURN
28 __terminate(terminate_handler func
) noexcept
;
35 _LIBCXXABI_DATA_VIS
extern void (*__cxa_terminate_handler
)();
36 _LIBCXXABI_DATA_VIS
extern void (*__cxa_unexpected_handler
)();
37 _LIBCXXABI_DATA_VIS
extern void (*__cxa_new_handler
)();
41 At some point in the future these three symbols will become
42 C++11 atomic variables:
44 extern std::atomic<std::terminate_handler> __cxa_terminate_handler;
45 extern std::atomic<std::unexpected_handler> __cxa_unexpected_handler;
46 extern std::atomic<std::new_handler> __cxa_new_handler;
48 This change will not impact their ABI. But it will allow for a
49 portable performance optimization.
55 #endif // _CXA_HANDLERS_H