[compiler-rt] r255285 - [PGO] Move target-dependent macro to InstrProfilingPort.h (NFC)

Xinliang David Li via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 10 11:20:25 PST 2015


Author: davidxl
Date: Thu Dec 10 13:20:25 2015
New Revision: 255285

URL: http://llvm.org/viewvc/llvm-project?rev=255285&view=rev
Log:
[PGO] Move target-dependent macro to InstrProfilingPort.h (NFC)

Modified:
    compiler-rt/trunk/lib/profile/InstrProfiling.c
    compiler-rt/trunk/lib/profile/InstrProfilingPort.h

Modified: compiler-rt/trunk/lib/profile/InstrProfiling.c
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/profile/InstrProfiling.c?rev=255285&r1=255284&r2=255285&view=diff
==============================================================================
--- compiler-rt/trunk/lib/profile/InstrProfiling.c (original)
+++ compiler-rt/trunk/lib/profile/InstrProfiling.c Thu Dec 10 13:20:25 2015
@@ -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 *O
   }
   return 0;
 }
-#define BOOL_CMPXCHG(Ptr, OldV, NewV) BoolCmpXchg((void **)Ptr, OldV, NewV)
 #endif
 
 char *(*GetEnvHook)(const char *) = 0;

Modified: compiler-rt/trunk/lib/profile/InstrProfilingPort.h
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/profile/InstrProfilingPort.h?rev=255285&r1=255284&r2=255285&view=diff
==============================================================================
--- compiler-rt/trunk/lib/profile/InstrProfilingPort.h (original)
+++ compiler-rt/trunk/lib/profile/InstrProfilingPort.h Thu Dec 10 13:20:25 2015
@@ -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__)




More information about the llvm-commits mailing list