[PGO] use COMPILER_RT_HAS_ATOMTICS macro

llvm-svn: 255266
This commit is contained in:
Xinliang David Li 2015-12-10 17:27:53 +00:00
parent 02fe4248a2
commit b247bfb23b
1 changed files with 4 additions and 4 deletions

View File

@ -23,7 +23,10 @@
return 0; \ 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 LLVM_LIBRARY_VISIBILITY
uint32_t BoolCmpXchg(void **Ptr, void *OldV, void *NewV) { uint32_t BoolCmpXchg(void **Ptr, void *OldV, void *NewV) {
void *R = *Ptr; void *R = *Ptr;
@ -34,9 +37,6 @@ uint32_t BoolCmpXchg(void **Ptr, void *OldV, void *NewV) {
return 0; return 0;
} }
#define BOOL_CMPXCHG(Ptr, OldV, NewV) BoolCmpXchg((void **)Ptr, OldV, NewV) #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 #endif
char *(*GetEnvHook)(const char *) = 0; char *(*GetEnvHook)(const char *) = 0;