summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--compiler-rt/lib/profile/InstrProfiling.c6
-rw-r--r--compiler-rt/lib/profile/InstrProfilingPort.h8
2 files changed, 9 insertions, 5 deletions
diff --git a/compiler-rt/lib/profile/InstrProfiling.c b/compiler-rt/lib/profile/InstrProfiling.c
index a6d4d8945be..44f8ce5a70d 100644
--- a/compiler-rt/lib/profile/InstrProfiling.c
+++ b/compiler-rt/lib/profile/InstrProfiling.c
@@ -23,10 +23,7 @@
return 0; \
}
-#if COMPILER_RT_HAS_ATOMICS == 1
-#define BOOL_CMPXCHG(Ptr, OldV, NewV) \
- __sync_bool_compare_and_swap(Ptr, OldV, NewV)
-#else
+#if COMPILER_RT_HAS_ATOMICS != 1
LLVM_LIBRARY_VISIBILITY
uint32_t BoolCmpXchg(void **Ptr, void *OldV, void *NewV) {
void *R = *Ptr;
@@ -36,7 +33,6 @@ uint32_t BoolCmpXchg(void **Ptr, void *OldV, void *NewV) {
}
return 0;
}
-#define BOOL_CMPXCHG(Ptr, OldV, NewV) BoolCmpXchg((void **)Ptr, OldV, NewV)
#endif
char *(*GetEnvHook)(const char *) = 0;
diff --git a/compiler-rt/lib/profile/InstrProfilingPort.h b/compiler-rt/lib/profile/InstrProfilingPort.h
index b75add8ff53..9134575fd50 100644
--- a/compiler-rt/lib/profile/InstrProfilingPort.h
+++ b/compiler-rt/lib/profile/InstrProfilingPort.h
@@ -23,6 +23,14 @@
if (GetEnvHook && GetEnvHook("LLVM_PROFILE_VERBOSE_ERRORS")) \
fprintf(stderr, Format, __VA_ARGS__);
+#if COMPILER_RT_HAS_ATOMICS == 1
+#define BOOL_CMPXCHG(Ptr, OldV, NewV) \
+ __sync_bool_compare_and_swap(Ptr, OldV, NewV)
+#else
+#define BOOL_CMPXCHG(Ptr, OldV, NewV) BoolCmpXchg((void **)Ptr, OldV, NewV)
+#endif
+
+
extern char *(*GetEnvHook)(const char *);
#if defined(__FreeBSD__) && defined(__i386__)
OpenPOWER on IntegriCloud