diff options
author | Xinliang David Li <davidxl@google.com> | 2015-12-10 17:27:53 +0000 |
---|---|---|
committer | Xinliang David Li <davidxl@google.com> | 2015-12-10 17:27:53 +0000 |
commit | 6e76a470df34fa184105d8eb8cc71d7d223f622c (patch) | |
tree | caa3e08809e4637c28522c51adc3300fc7612a6b /lib/profile/InstrProfiling.c | |
parent | 464d7efbd87db174bd1a31c1071caf1030d22d82 (diff) |
[PGO] use COMPILER_RT_HAS_ATOMTICS macro
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@255266 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/profile/InstrProfiling.c')
-rw-r--r-- | lib/profile/InstrProfiling.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/profile/InstrProfiling.c b/lib/profile/InstrProfiling.c index fe560b8a9..a6d4d8945 100644 --- a/lib/profile/InstrProfiling.c +++ b/lib/profile/InstrProfiling.c @@ -23,7 +23,10 @@ return 0; \ } -#ifdef _MIPS_ARCH +#if COMPILER_RT_HAS_ATOMICS == 1 +#define BOOL_CMPXCHG(Ptr, OldV, NewV) \ + __sync_bool_compare_and_swap(Ptr, OldV, NewV) +#else LLVM_LIBRARY_VISIBILITY uint32_t BoolCmpXchg(void **Ptr, void *OldV, void *NewV) { void *R = *Ptr; @@ -34,9 +37,6 @@ uint32_t BoolCmpXchg(void **Ptr, void *OldV, void *NewV) { return 0; } #define BOOL_CMPXCHG(Ptr, OldV, NewV) BoolCmpXchg((void **)Ptr, OldV, NewV) -#else -#define BOOL_CMPXCHG(Ptr, OldV, NewV) \ - __sync_bool_compare_and_swap(Ptr, OldV, NewV) #endif char *(*GetEnvHook)(const char *) = 0; |