summaryrefslogtreecommitdiffstats
path: root/libcxx/src/support/runtime
diff options
context:
space:
mode:
authorWeiming Zhao <weimingz@codeaurora.org>2017-07-10 21:23:32 +0000
committerWeiming Zhao <weimingz@codeaurora.org>2017-07-10 21:23:32 +0000
commitba5b8c8ee77e7b2c2d05c04a36d15a9b5182e314 (patch)
tree2df7891ba4bd91f35039e8026bd86104cd248b6a /libcxx/src/support/runtime
parent77f23b9c218cd87d4eb5d6c40d876d640b389ae7 (diff)
downloadbcm5719-llvm-ba5b8c8ee77e7b2c2d05c04a36d15a9b5182e314.tar.gz
bcm5719-llvm-ba5b8c8ee77e7b2c2d05c04a36d15a9b5182e314.zip
Revert "[libc++] Refactoring __sync_* builtins; NFC"
This reverts commit 72ff8866bca49ee7d24c87673293b4ce88a039ec. llvm-svn: 307593
Diffstat (limited to 'libcxx/src/support/runtime')
-rw-r--r--libcxx/src/support/runtime/exception_fallback.ipp10
-rw-r--r--libcxx/src/support/runtime/new_handler_fallback.ipp6
2 files changed, 7 insertions, 9 deletions
diff --git a/libcxx/src/support/runtime/exception_fallback.ipp b/libcxx/src/support/runtime/exception_fallback.ipp
index cdf008afef7..69c06a9ce3a 100644
--- a/libcxx/src/support/runtime/exception_fallback.ipp
+++ b/libcxx/src/support/runtime/exception_fallback.ipp
@@ -9,7 +9,6 @@
//===----------------------------------------------------------------------===//
#include <cstdio>
-#include <__atomic_support>
namespace std {
@@ -21,13 +20,13 @@ _LIBCPP_SAFE_STATIC static std::unexpected_handler __unexpected_handler;
unexpected_handler
set_unexpected(unexpected_handler func) _NOEXCEPT
{
- return __libcpp_sync_lock_test_and_set(&__unexpected_handler, func);
+ return __sync_lock_test_and_set(&__unexpected_handler, func);
}
unexpected_handler
get_unexpected() _NOEXCEPT
{
- return __libcpp_sync_fetch_and_add(&__unexpected_handler, (unexpected_handler)0);
+ return __sync_fetch_and_add(&__unexpected_handler, (unexpected_handler)0);
}
@@ -42,13 +41,14 @@ void unexpected()
terminate_handler
set_terminate(terminate_handler func) _NOEXCEPT
{
- return __libcpp_sync_lock_test_and_set(&__terminate_handler, func);
+ return __sync_lock_test_and_set(&__terminate_handler, func);
}
terminate_handler
get_terminate() _NOEXCEPT
{
- return __libcpp_sync_fetch_and_add(&__terminate_handler, (terminate_handler)0);
+ return __sync_fetch_and_add(&__terminate_handler, (terminate_handler)0);
+
}
#ifndef __EMSCRIPTEN__ // We provide this in JS
diff --git a/libcxx/src/support/runtime/new_handler_fallback.ipp b/libcxx/src/support/runtime/new_handler_fallback.ipp
index 75f985d3914..b7092d542d9 100644
--- a/libcxx/src/support/runtime/new_handler_fallback.ipp
+++ b/libcxx/src/support/runtime/new_handler_fallback.ipp
@@ -8,8 +8,6 @@
//
//===----------------------------------------------------------------------===//
-#include <__atomic_support>
-
namespace std {
_LIBCPP_SAFE_STATIC static std::new_handler __new_handler;
@@ -17,13 +15,13 @@ _LIBCPP_SAFE_STATIC static std::new_handler __new_handler;
new_handler
set_new_handler(new_handler handler) _NOEXCEPT
{
- return __libcpp_sync_lock_test_and_set(&__new_handler, handler);
+ return __sync_lock_test_and_set(&__new_handler, handler);
}
new_handler
get_new_handler() _NOEXCEPT
{
- return __libcpp_sync_fetch_and_add<new_handler>(&__new_handler, nullptr);
+ return __sync_fetch_and_add(&__new_handler, nullptr);
}
} // namespace std
OpenPOWER on IntegriCloud