Atomic ops that do arithmetic use signed arithmetic.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73980 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/System/Atomic.cpp b/lib/System/Atomic.cpp
index 65e1469..fda2708 100644
--- a/lib/System/Atomic.cpp
+++ b/lib/System/Atomic.cpp
@@ -52,7 +52,7 @@
#endif
}
-uint32_t sys::AtomicIncrement32(volatile uint32_t* ptr) {
+int32_t sys::AtomicIncrement32(volatile int32_t* ptr) {
#if LLVM_MULTITHREADED==0
++(*ptr);
return *ptr;
@@ -65,7 +65,7 @@
#endif
}
-uint32_t sys::AtomicDecrement32(volatile uint32_t* ptr) {
+int32_t sys::AtomicDecrement32(volatile int32_t* ptr) {
#if LLVM_MULTITHREADED==0
--(*ptr);
return *ptr;
@@ -78,7 +78,7 @@
#endif
}
-uint32_t sys::AtomicAdd32(volatile uint32_t* ptr, uint32_t val) {
+int32_t sys::AtomicAdd32(volatile int32_t* ptr, int32_t val) {
#if LLVM_MULTITHREADED==0
*ptr += val;
return *ptr;
@@ -91,7 +91,7 @@
#endif
}
-uint64_t sys::AtomicAdd64(volatile uint64_t* ptr, uint64_t val) {
+int64_t sys::AtomicAdd64(volatile int64_t* ptr, int64_t val) {
#if LLVM_MULTITHREADED==0
*ptr += val;
return *ptr;