From b247bfb23b1c19ba2b78f61456f20d6924f2ef9d Mon Sep 17 00:00:00 2001 From: Xinliang David Li Date: Thu, 10 Dec 2015 17:27:53 +0000 Subject: [PATCH] [PGO] use COMPILER_RT_HAS_ATOMTICS macro llvm-svn: 255266 --- compiler-rt/lib/profile/InstrProfiling.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/compiler-rt/lib/profile/InstrProfiling.c b/compiler-rt/lib/profile/InstrProfiling.c index fe560b8a98d0..a6d4d8945beb 100644 --- a/compiler-rt/lib/profile/InstrProfiling.c +++ b/compiler-rt/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;