summaryrefslogtreecommitdiffstats
path: root/include/llvm/System
diff options
context:
space:
mode:
authorOwen Anderson <resistor@mac.com>2009-05-19 22:18:56 +0000
committerOwen Anderson <resistor@mac.com>2009-05-19 22:18:56 +0000
commita86037084d8c2338c305533807b3213cfdc47a3e (patch)
treecedee6e1057dcd871c41a1e150497f264ef4bffa /include/llvm/System
parent6aa219a18c59a9bc0b1eeb6eece09cfabaaefabe (diff)
downloadexternal_llvm-a86037084d8c2338c305533807b3213cfdc47a3e.zip
external_llvm-a86037084d8c2338c305533807b3213cfdc47a3e.tar.gz
external_llvm-a86037084d8c2338c305533807b3213cfdc47a3e.tar.bz2
Split the ENABLE_THREADS #define in two. Now ENABLE_THREADS indicates the ability to run multiple threads at once in the JIT, and requires only
mutex support. LLVM_MULTITHREADED indicates (or will indicate) the ability to run LLVM itself across multiple threads, and requires atomics support. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72140 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/System')
-rw-r--r--include/llvm/System/Atomic.h12
1 files changed, 3 insertions, 9 deletions
diff --git a/include/llvm/System/Atomic.h b/include/llvm/System/Atomic.h
index 5830b37..38388a4 100644
--- a/include/llvm/System/Atomic.h
+++ b/include/llvm/System/Atomic.h
@@ -23,14 +23,8 @@ namespace llvm {
namespace sys {
inline void MemoryFence() {
-#if !defined(ENABLE_THREADS) || ENABLE_THREADS == 0
-# if defined(__GNUC__)
- __asm__ __volatile__("" : : : "memory");
-# elif defined(_MSC_VER)
- __asm { };
-# else
-# error No memory fence implementation for your platform!
-# endif
+#if LLVM_MULTITHREADED==0
+ return;
#else
# if defined(__GNUC__)
__sync_synchronize();
@@ -42,7 +36,7 @@ namespace llvm {
#endif
}
-#if !defined(ENABLE_THREADS) || ENABLE_THREADS == 0
+#if LLVM_MULTITHREADED==0
typedef unsigned long cas_flag;
template<typename T>
inline T CompareAndSwap(volatile T* dest,