diff options
| author | Weiming Zhao <weimingz@codeaurora.org> | 2017-07-10 21:23:32 +0000 |
|---|---|---|
| committer | Weiming Zhao <weimingz@codeaurora.org> | 2017-07-10 21:23:32 +0000 |
| commit | ba5b8c8ee77e7b2c2d05c04a36d15a9b5182e314 (patch) | |
| tree | 2df7891ba4bd91f35039e8026bd86104cd248b6a /libcxx/include/__refstring | |
| parent | 77f23b9c218cd87d4eb5d6c40d876d640b389ae7 (diff) | |
| download | bcm5719-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/include/__refstring')
| -rw-r--r-- | libcxx/include/__refstring | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/libcxx/include/__refstring b/libcxx/include/__refstring index de89b79a4b9..7f417a03c49 100644 --- a/libcxx/include/__refstring +++ b/libcxx/include/__refstring @@ -14,7 +14,6 @@ #include <stdexcept> #include <cstddef> #include <cstring> -#include <__atomic_support> #ifdef __APPLE__ #include <dlfcn.h> #include <mach-o/dyld.h> @@ -84,7 +83,7 @@ __libcpp_refstring::__libcpp_refstring(const __libcpp_refstring &s) _NOEXCEPT : __imp_(s.__imp_) { if (__uses_refcount()) - __libcpp_sync_add_and_fetch(&rep_from_data(__imp_)->count, 1); + __sync_add_and_fetch(&rep_from_data(__imp_)->count, 1); } inline @@ -93,10 +92,10 @@ __libcpp_refstring& __libcpp_refstring::operator=(__libcpp_refstring const& s) _ struct _Rep_base *old_rep = rep_from_data(__imp_); __imp_ = s.__imp_; if (__uses_refcount()) - __libcpp_sync_add_and_fetch(&rep_from_data(__imp_)->count, 1); + __sync_add_and_fetch(&rep_from_data(__imp_)->count, 1); if (adjust_old_count) { - if (__libcpp_sync_add_and_fetch(&old_rep->count, count_t(-1)) < 0) + if (__sync_add_and_fetch(&old_rep->count, count_t(-1)) < 0) { ::operator delete(old_rep); } @@ -108,7 +107,7 @@ inline __libcpp_refstring::~__libcpp_refstring() { if (__uses_refcount()) { _Rep_base* rep = rep_from_data(__imp_); - if (__libcpp_sync_add_and_fetch(&rep->count, count_t(-1)) < 0) { + if (__sync_add_and_fetch(&rep->count, count_t(-1)) < 0) { ::operator delete(rep); } } |

