summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorChandler Carruth <chandlerc@gmail.com>2016-06-02 17:11:11 +0000
committerChandler Carruth <chandlerc@gmail.com>2016-06-02 17:11:11 +0000
commit49471dfb31efae6adea4f6f820e61ccd096b64e2 (patch)
tree89165257773983cb4440b4af8632675b5305d2e7 /llvm/lib
parent2da433ea997e0a48696c4b253894a796c6c1af9f (diff)
downloadbcm5719-llvm-49471dfb31efae6adea4f6f820e61ccd096b64e2.tar.gz
bcm5719-llvm-49471dfb31efae6adea4f6f820e61ccd096b64e2.zip
Remove all of the legacy home-grown atomic operations LLVM provided
except for CompareAndSwap. That is the only one still being used anywhere now that statistics have been moved onto std::atomic. Also, add a warning to the header that we shouldn't introduce more uses of these old style atomics and instead should be using C++11's std::atomic facilities. Really hoping that we can hammer out the last couple of users here and replace them with something more localized and/or principled, but figured this was a pretty good start. =] Note that this patch will need to be reverted if r271504 needs to be reverted as that removes the last user of these. However, the biggest risk for that patch was MSVC 2013 and at least one bot has already passed where it would have failed there. I've tested MSVC 2015 using their web interfaces and other platforms seem fine, so I'm optimistic. Differential Revision: http://reviews.llvm.org/D20901 llvm-svn: 271540
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Support/Atomic.cpp59
1 files changed, 0 insertions, 59 deletions
diff --git a/llvm/lib/Support/Atomic.cpp b/llvm/lib/Support/Atomic.cpp
index ac4ff3eb5c6..80550e2b46a 100644
--- a/llvm/lib/Support/Atomic.cpp
+++ b/llvm/lib/Support/Atomic.cpp
@@ -56,62 +56,3 @@ sys::cas_flag sys::CompareAndSwap(volatile sys::cas_flag* ptr,
# error No compare-and-swap implementation for your platform!
#endif
}
-
-sys::cas_flag sys::AtomicIncrement(volatile sys::cas_flag* ptr) {
-#if LLVM_HAS_ATOMICS == 0
- ++(*ptr);
- return *ptr;
-#elif defined(GNU_ATOMICS)
- return __sync_add_and_fetch(ptr, 1);
-#elif defined(_MSC_VER)
- return InterlockedIncrement(ptr);
-#else
-# error No atomic increment implementation for your platform!
-#endif
-}
-
-sys::cas_flag sys::AtomicDecrement(volatile sys::cas_flag* ptr) {
-#if LLVM_HAS_ATOMICS == 0
- --(*ptr);
- return *ptr;
-#elif defined(GNU_ATOMICS)
- return __sync_sub_and_fetch(ptr, 1);
-#elif defined(_MSC_VER)
- return InterlockedDecrement(ptr);
-#else
-# error No atomic decrement implementation for your platform!
-#endif
-}
-
-sys::cas_flag sys::AtomicAdd(volatile sys::cas_flag* ptr, sys::cas_flag val) {
-#if LLVM_HAS_ATOMICS == 0
- *ptr += val;
- return *ptr;
-#elif defined(GNU_ATOMICS)
- return __sync_add_and_fetch(ptr, val);
-#elif defined(_MSC_VER)
- return InterlockedExchangeAdd(ptr, val) + val;
-#else
-# error No atomic add implementation for your platform!
-#endif
-}
-
-sys::cas_flag sys::AtomicMul(volatile sys::cas_flag* ptr, sys::cas_flag val) {
- sys::cas_flag original, result;
- do {
- original = *ptr;
- result = original * val;
- } while (sys::CompareAndSwap(ptr, result, original) != original);
-
- return result;
-}
-
-sys::cas_flag sys::AtomicDiv(volatile sys::cas_flag* ptr, sys::cas_flag val) {
- sys::cas_flag original, result;
- do {
- original = *ptr;
- result = original / val;
- } while (sys::CompareAndSwap(ptr, result, original) != original);
-
- return result;
-}
OpenPOWER on IntegriCloud