[compiler-rt] r255266 - [PGO] use COMPILER_RT_HAS_ATOMTICS macro
Xinliang David Li via llvm-commits
llvm-commits at lists.llvm.org
Thu Dec 10 09:27:58 PST 2015
Author: davidxl
Date: Thu Dec 10 11:27:53 2015
New Revision: 255266
URL: http://llvm.org/viewvc/llvm-project?rev=255266&view=rev
Log:
[PGO] use COMPILER_RT_HAS_ATOMTICS macro
Modified:
compiler-rt/trunk/lib/profile/InstrProfiling.c
Modified: compiler-rt/trunk/lib/profile/InstrProfiling.c
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/profile/InstrProfiling.c?rev=255266&r1=255265&r2=255266&view=diff
==============================================================================
--- compiler-rt/trunk/lib/profile/InstrProfiling.c (original)
+++ compiler-rt/trunk/lib/profile/InstrProfiling.c Thu Dec 10 11:27:53 2015
@@ -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 *O
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;
More information about the llvm-commits
mailing list