summaryrefslogtreecommitdiffstats
path: root/libcxxabi/src/cxa_handlers.cpp
diff options
context:
space:
mode:
authorHoward Hinnant <hhinnant@apple.com>2012-03-19 16:20:34 +0000
committerHoward Hinnant <hhinnant@apple.com>2012-03-19 16:20:34 +0000
commit4ac72dd982539d681eb0ab988ccbb6f4594c6ecc (patch)
tree10ed2e3a06cd3e6108d1e760932a48cc410b26cf /libcxxabi/src/cxa_handlers.cpp
parentbed1cb1e13ce73d485e7939f9e2b022a01779960 (diff)
downloadbcm5719-llvm-4ac72dd982539d681eb0ab988ccbb6f4594c6ecc.tar.gz
bcm5719-llvm-4ac72dd982539d681eb0ab988ccbb6f4594c6ecc.zip
I've moved __cxa_terminate_handler, __cxa_unexpected_handler and __cxa_new_handler from the public header cxxabi.h into the private header cxa_handlers.hpp. During this move I've also moved them from namespace __cxxabiapple into the global namespace. They are, and have always been extern C and so the namespace (or lack of it) does not affect their ABI. In general external clients should not reference these symbols. They are atomic variables and will be changing into C++11 atomic variables in the future. However for those few clients who really need access to them, their name, mangling, size, alignment and layout will remain stable. You just may need your own declaration of them. Include guards have been added to the private header cxa_exception.hpp. The private header cxa_default_handlers.hpp has been removed and the default handlers are now file-static. Include guards have been added to the private header cxa_handlers.hpp.
llvm-svn: 153039
Diffstat (limited to 'libcxxabi/src/cxa_handlers.cpp')
-rw-r--r--libcxxabi/src/cxa_handlers.cpp13
1 files changed, 6 insertions, 7 deletions
diff --git a/libcxxabi/src/cxa_handlers.cpp b/libcxxabi/src/cxa_handlers.cpp
index 97f1347010e..3150c0a6de0 100644
--- a/libcxxabi/src/cxa_handlers.cpp
+++ b/libcxxabi/src/cxa_handlers.cpp
@@ -17,18 +17,15 @@
#include "cxxabi.h"
#include "cxa_handlers.hpp"
#include "cxa_exception.hpp"
-#include "cxa_default_handlers.hpp"
#include "private_typeinfo.h"
-std::new_handler __cxa_new_handler = 0;
-
namespace std
{
unexpected_handler
get_unexpected() _NOEXCEPT
{
- return __cxxabiapple::__cxa_unexpected_handler;
+ return __cxa_unexpected_handler;
}
__attribute__((visibility("hidden"), noreturn))
@@ -50,7 +47,7 @@ unexpected()
terminate_handler
get_terminate() _NOEXCEPT
{
- return __cxxabiapple::__cxa_terminate_handler;
+ return __cxa_terminate_handler;
}
__attribute__((visibility("hidden"), noreturn))
@@ -98,16 +95,18 @@ terminate() _NOEXCEPT
__terminate(get_terminate());
}
+new_handler __cxa_new_handler = 0;
+
new_handler
set_new_handler(new_handler handler) _NOEXCEPT
{
- return __sync_swap(&__cxxabiapple::__cxa_new_handler, handler);
+ return __sync_swap(&__cxa_new_handler, handler);
}
new_handler
get_new_handler() _NOEXCEPT
{
- return __cxxabiapple::__cxa_new_handler;
+ return __cxa_new_handler;
}
} // std
OpenPOWER on IntegriCloud