summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorEric Fiselier <eric@efcs.ca>2017-07-12 01:16:33 +0000
committerEric Fiselier <eric@efcs.ca>2017-07-12 01:16:33 +0000
commitd60e344b70d220f9f9b9f2b9fac306179934e271 (patch)
tree9769fb3e013d0ac2136db5007c5b371406439d95 /src
parent347be61138344a566133e99b4514b1da16a81c87 (diff)
Revert "[libc++] Refactoring __sync_* builtins; NFC (Reland)"
This reverts commit r307595. The commit had some issues that needed to first be addressed in review. git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@307746 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'src')
-rw-r--r--src/locale.cpp3
-rw-r--r--src/support/runtime/exception_fallback.ipp10
-rw-r--r--src/support/runtime/new_handler_fallback.ipp6
3 files changed, 8 insertions, 11 deletions
diff --git a/src/locale.cpp b/src/locale.cpp
index e73e6d57d..3b4c83a09 100644
--- a/src/locale.cpp
+++ b/src/locale.cpp
@@ -28,7 +28,6 @@
#define _CTYPE_DISABLE_MACROS
#endif
#include "cwctype"
-#include "__atomic_support"
#include "__sso_allocator"
#if defined(_LIBCPP_MSVCRT) || defined(__MINGW32__)
#include "support/win32/locale_win32.h"
@@ -668,7 +667,7 @@ locale::id::__get()
void
locale::id::__init()
{
- __id_ = __libcpp_sync_add_and_fetch(&__next_id, 1);
+ __id_ = __sync_add_and_fetch(&__next_id, 1);
}
// template <> class collate_byname<char>
diff --git a/src/support/runtime/exception_fallback.ipp b/src/support/runtime/exception_fallback.ipp
index cdf008afe..69c06a9ce 100644
--- a/src/support/runtime/exception_fallback.ipp
+++ b/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/src/support/runtime/new_handler_fallback.ipp b/src/support/runtime/new_handler_fallback.ipp
index 75f985d39..b7092d542 100644
--- a/src/support/runtime/new_handler_fallback.ipp
+++ b/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