diff --git a/llvm/lib/System/Atomic.cpp b/llvm/lib/System/Atomic.cpp index 5676ca9d62c5..416f981df827 100644 --- a/llvm/lib/System/Atomic.cpp +++ b/llvm/lib/System/Atomic.cpp @@ -59,7 +59,7 @@ sys::cas_flag sys::AtomicIncrement(volatile sys::cas_flag* ptr) { #elif defined(__GNUC__) return __sync_add_and_fetch(ptr, 1); #elif defined(_MSC_VER) - return InterlockedCompareExchange(ptr, new_value, old_value); + return InterlockedIncrement(ptr); #else # error No atomic increment implementation for your platform! #endif @@ -72,7 +72,7 @@ sys::cas_flag sys::AtomicDecrement(volatile sys::cas_flag* ptr) { #elif defined(__GNUC__) return __sync_sub_and_fetch(ptr, 1); #elif defined(_MSC_VER) - return InterlockedIncrement(ptr); + return InterlockedDecrement(ptr); #else # error No atomic decrement implementation for your platform! #endif