diff options
| author | Xinliang David Li <davidxl@google.com> | 2015-12-10 19:20:25 +0000 |
|---|---|---|
| committer | Xinliang David Li <davidxl@google.com> | 2015-12-10 19:20:25 +0000 |
| commit | e8c18a1bd16057aa5e9658ff7f32372680887aec (patch) | |
| tree | 109334a407275e1faa84226ab89f7cb56731ea9c /compiler-rt | |
| parent | 01faef0ddccff6213f2391fe2deb7dbb616ff67e (diff) | |
| download | bcm5719-llvm-e8c18a1bd16057aa5e9658ff7f32372680887aec.tar.gz bcm5719-llvm-e8c18a1bd16057aa5e9658ff7f32372680887aec.zip | |
[PGO] Move target-dependent macro to InstrProfilingPort.h (NFC)
llvm-svn: 255285
Diffstat (limited to 'compiler-rt')
| -rw-r--r-- | compiler-rt/lib/profile/InstrProfiling.c | 6 | ||||
| -rw-r--r-- | compiler-rt/lib/profile/InstrProfilingPort.h | 8 |
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__) |

