[compiler-rt] r255748 - [PGO] cleanup: unify prefix for portability macros

Xinliang David Li via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 15 19:29:15 PST 2015


Author: davidxl
Date: Tue Dec 15 21:29:15 2015
New Revision: 255748

URL: http://llvm.org/viewvc/llvm-project?rev=255748&view=rev
Log:
[PGO] cleanup: unify prefix for portability macros

Modified:
    compiler-rt/trunk/lib/profile/InstrProfiling.c
    compiler-rt/trunk/lib/profile/InstrProfiling.h
    compiler-rt/trunk/lib/profile/InstrProfilingBuffer.c
    compiler-rt/trunk/lib/profile/InstrProfilingFile.c
    compiler-rt/trunk/lib/profile/InstrProfilingPlatformDarwin.c
    compiler-rt/trunk/lib/profile/InstrProfilingPlatformLinux.c
    compiler-rt/trunk/lib/profile/InstrProfilingPlatformOther.c
    compiler-rt/trunk/lib/profile/InstrProfilingPort.h
    compiler-rt/trunk/lib/profile/InstrProfilingRuntime.cc
    compiler-rt/trunk/lib/profile/InstrProfilingUtil.c
    compiler-rt/trunk/lib/profile/InstrProfilingValue.c
    compiler-rt/trunk/lib/profile/InstrProfilingWriter.c

Modified: compiler-rt/trunk/lib/profile/InstrProfiling.c
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/profile/InstrProfiling.c?rev=255748&r1=255747&r2=255748&view=diff
==============================================================================
--- compiler-rt/trunk/lib/profile/InstrProfiling.c (original)
+++ compiler-rt/trunk/lib/profile/InstrProfiling.c Tue Dec 15 21:29:15 2015
@@ -18,7 +18,7 @@
 
 char *(*GetEnvHook)(const char *) = 0;
 
-LLVM_LIBRARY_VISIBILITY uint64_t __llvm_profile_get_magic(void) {
+COMPILER_RT_VISIBILITY uint64_t __llvm_profile_get_magic(void) {
   return sizeof(void *) == sizeof(uint64_t) ? (INSTR_PROF_RAW_MAGIC_64)
                                             : (INSTR_PROF_RAW_MAGIC_32);
 }
@@ -26,16 +26,16 @@ LLVM_LIBRARY_VISIBILITY uint64_t __llvm_
 /* Return the number of bytes needed to add to SizeInBytes to make it
  *   the result a multiple of 8.
  */
-LLVM_LIBRARY_VISIBILITY uint8_t
+COMPILER_RT_VISIBILITY uint8_t
 __llvm_profile_get_num_padding_bytes(uint64_t SizeInBytes) {
   return 7 & (sizeof(uint64_t) - SizeInBytes % sizeof(uint64_t));
 }
 
-LLVM_LIBRARY_VISIBILITY uint64_t __llvm_profile_get_version(void) {
+COMPILER_RT_VISIBILITY uint64_t __llvm_profile_get_version(void) {
   return INSTR_PROF_RAW_VERSION;
 }
 
-LLVM_LIBRARY_VISIBILITY void __llvm_profile_reset_counters(void) {
+COMPILER_RT_VISIBILITY void __llvm_profile_reset_counters(void) {
   uint64_t *I = __llvm_profile_begin_counters();
   uint64_t *E = __llvm_profile_end_counters();
 

Modified: compiler-rt/trunk/lib/profile/InstrProfiling.h
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/profile/InstrProfiling.h?rev=255748&r1=255747&r2=255748&view=diff
==============================================================================
--- compiler-rt/trunk/lib/profile/InstrProfiling.h (original)
+++ compiler-rt/trunk/lib/profile/InstrProfiling.h Tue Dec 15 21:29:15 2015
@@ -19,7 +19,8 @@ enum ValueKind {
 };
 
 typedef void *IntPtrT;
-typedef struct LLVM_ALIGNAS(INSTR_PROF_DATA_ALIGNMENT) __llvm_profile_data {
+typedef struct COMPILER_RT_ALIGNAS(INSTR_PROF_DATA_ALIGNMENT)
+    __llvm_profile_data {
 #define INSTR_PROF_DATA(Type, LLVMType, Name, Initializer) Type Name;
 #include "InstrProfData.inc"
 } __llvm_profile_data;

Modified: compiler-rt/trunk/lib/profile/InstrProfilingBuffer.c
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/profile/InstrProfilingBuffer.c?rev=255748&r1=255747&r2=255748&view=diff
==============================================================================
--- compiler-rt/trunk/lib/profile/InstrProfilingBuffer.c (original)
+++ compiler-rt/trunk/lib/profile/InstrProfilingBuffer.c Tue Dec 15 21:29:15 2015
@@ -12,7 +12,7 @@
 
 #include <string.h>
 
-LLVM_LIBRARY_VISIBILITY
+COMPILER_RT_VISIBILITY
 uint64_t __llvm_profile_get_size_for_buffer(void) {
   const __llvm_profile_data *DataBegin = __llvm_profile_begin_data();
   const __llvm_profile_data *DataEnd = __llvm_profile_end_data();
@@ -27,7 +27,7 @@ uint64_t __llvm_profile_get_size_for_buf
 
 #define PROFILE_RANGE_SIZE(Range) (Range##End - Range##Begin)
 
-LLVM_LIBRARY_VISIBILITY
+COMPILER_RT_VISIBILITY
 uint64_t __llvm_profile_get_size_for_buffer_internal(
     const __llvm_profile_data *DataBegin, const __llvm_profile_data *DataEnd,
     const uint64_t *CountersBegin, const uint64_t *CountersEnd,
@@ -55,12 +55,11 @@ static uint32_t bufferWriter(ProfDataIOV
   return 0;
 }
 
-LLVM_LIBRARY_VISIBILITY int
-__llvm_profile_write_buffer(char *Buffer) {
+COMPILER_RT_VISIBILITY int __llvm_profile_write_buffer(char *Buffer) {
   return llvmWriteProfData(bufferWriter, Buffer, 0, 0);
 }
 
-LLVM_LIBRARY_VISIBILITY int __llvm_profile_write_buffer_internal(
+COMPILER_RT_VISIBILITY int __llvm_profile_write_buffer_internal(
     char *Buffer, const __llvm_profile_data *DataBegin,
     const __llvm_profile_data *DataEnd, const uint64_t *CountersBegin,
     const uint64_t *CountersEnd, const char *NamesBegin, const char *NamesEnd) {

Modified: compiler-rt/trunk/lib/profile/InstrProfilingFile.c
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/profile/InstrProfilingFile.c?rev=255748&r1=255747&r2=255748&view=diff
==============================================================================
--- compiler-rt/trunk/lib/profile/InstrProfilingFile.c (original)
+++ compiler-rt/trunk/lib/profile/InstrProfilingFile.c Tue Dec 15 21:29:15 2015
@@ -56,8 +56,8 @@ static int writeFileWithName(const char
   return RetVal;
 }
 
-LLVM_LIBRARY_WEAK int __llvm_profile_OwnsFilename = 0;
-LLVM_LIBRARY_WEAK const char *__llvm_profile_CurrentFilename = NULL;
+COMPILER_RT_WEAK int __llvm_profile_OwnsFilename = 0;
+COMPILER_RT_WEAK const char *__llvm_profile_CurrentFilename = NULL;
 
 static void truncateCurrentFile(void) {
   const char *Filename;
@@ -164,7 +164,7 @@ static void setFilenameAutomatically(voi
   resetFilenameToDefault();
 }
 
-LLVM_LIBRARY_VISIBILITY
+COMPILER_RT_VISIBILITY
 void __llvm_profile_initialize_file(void) {
   /* Check if the filename has been initialized. */
   if (__llvm_profile_CurrentFilename)
@@ -174,12 +174,12 @@ void __llvm_profile_initialize_file(void
   setFilenameAutomatically();
 }
 
-LLVM_LIBRARY_VISIBILITY
+COMPILER_RT_VISIBILITY
 void __llvm_profile_set_filename(const char *Filename) {
   setFilenamePossiblyWithPid(Filename);
 }
 
-LLVM_LIBRARY_VISIBILITY
+COMPILER_RT_VISIBILITY
 void __llvm_profile_override_default_filename(const char *Filename) {
   /* If the env var is set, skip setting filename from argument. */
   const char *Env_Filename = getenv("LLVM_PROFILE_FILE");
@@ -188,7 +188,7 @@ void __llvm_profile_override_default_fil
   setFilenamePossiblyWithPid(Filename);
 }
 
-LLVM_LIBRARY_VISIBILITY
+COMPILER_RT_VISIBILITY
 int __llvm_profile_write_file(void) {
   int rc;
 
@@ -209,7 +209,7 @@ int __llvm_profile_write_file(void) {
 
 static void writeFileWithoutReturn(void) { __llvm_profile_write_file(); }
 
-LLVM_LIBRARY_VISIBILITY
+COMPILER_RT_VISIBILITY
 int __llvm_profile_register_write_file_atexit(void) {
   static int HasBeenRegistered = 0;
 

Modified: compiler-rt/trunk/lib/profile/InstrProfilingPlatformDarwin.c
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/profile/InstrProfilingPlatformDarwin.c?rev=255748&r1=255747&r2=255748&view=diff
==============================================================================
--- compiler-rt/trunk/lib/profile/InstrProfilingPlatformDarwin.c (original)
+++ compiler-rt/trunk/lib/profile/InstrProfilingPlatformDarwin.c Tue Dec 15 21:29:15 2015
@@ -11,36 +11,36 @@
 
 #if defined(__APPLE__)
 /* Use linker magic to find the bounds of the Data section. */
-LLVM_LIBRARY_VISIBILITY
+COMPILER_RT_VISIBILITY
 extern __llvm_profile_data
     DataStart __asm("section$start$__DATA$" INSTR_PROF_DATA_SECT_NAME_STR);
-LLVM_LIBRARY_VISIBILITY
+COMPILER_RT_VISIBILITY
 extern __llvm_profile_data
     DataEnd __asm("section$end$__DATA$" INSTR_PROF_DATA_SECT_NAME_STR);
-LLVM_LIBRARY_VISIBILITY
+COMPILER_RT_VISIBILITY
 extern char
     NamesStart __asm("section$start$__DATA$" INSTR_PROF_NAME_SECT_NAME_STR);
-LLVM_LIBRARY_VISIBILITY
+COMPILER_RT_VISIBILITY
 extern char NamesEnd __asm("section$end$__DATA$" INSTR_PROF_NAME_SECT_NAME_STR);
-LLVM_LIBRARY_VISIBILITY
+COMPILER_RT_VISIBILITY
 extern uint64_t
     CountersStart __asm("section$start$__DATA$" INSTR_PROF_CNTS_SECT_NAME_STR);
-LLVM_LIBRARY_VISIBILITY
+COMPILER_RT_VISIBILITY
 extern uint64_t
     CountersEnd __asm("section$end$__DATA$" INSTR_PROF_CNTS_SECT_NAME_STR);
 
-LLVM_LIBRARY_VISIBILITY
+COMPILER_RT_VISIBILITY
 const __llvm_profile_data *__llvm_profile_begin_data(void) {
   return &DataStart;
 }
-LLVM_LIBRARY_VISIBILITY
+COMPILER_RT_VISIBILITY
 const __llvm_profile_data *__llvm_profile_end_data(void) { return &DataEnd; }
-LLVM_LIBRARY_VISIBILITY
+COMPILER_RT_VISIBILITY
 const char *__llvm_profile_begin_names(void) { return &NamesStart; }
-LLVM_LIBRARY_VISIBILITY
+COMPILER_RT_VISIBILITY
 const char *__llvm_profile_end_names(void) { return &NamesEnd; }
-LLVM_LIBRARY_VISIBILITY
+COMPILER_RT_VISIBILITY
 uint64_t *__llvm_profile_begin_counters(void) { return &CountersStart; }
-LLVM_LIBRARY_VISIBILITY
+COMPILER_RT_VISIBILITY
 uint64_t *__llvm_profile_end_counters(void) { return &CountersEnd; }
 #endif

Modified: compiler-rt/trunk/lib/profile/InstrProfilingPlatformLinux.c
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/profile/InstrProfilingPlatformLinux.c?rev=255748&r1=255747&r2=255748&view=diff
==============================================================================
--- compiler-rt/trunk/lib/profile/InstrProfilingPlatformLinux.c (original)
+++ compiler-rt/trunk/lib/profile/InstrProfilingPlatformLinux.c Tue Dec 15 21:29:15 2015
@@ -22,37 +22,38 @@
 /* Declare section start and stop symbols for various sections
  * generated by compiler instrumentation.
  */
-extern __llvm_profile_data PROF_DATA_START LLVM_LIBRARY_VISIBILITY;
-extern __llvm_profile_data PROF_DATA_STOP LLVM_LIBRARY_VISIBILITY;
-extern uint64_t PROF_CNTS_START LLVM_LIBRARY_VISIBILITY;
-extern uint64_t PROF_CNTS_STOP LLVM_LIBRARY_VISIBILITY;
-extern char PROF_NAME_START LLVM_LIBRARY_VISIBILITY;
-extern char PROF_NAME_STOP LLVM_LIBRARY_VISIBILITY;
+extern __llvm_profile_data PROF_DATA_START COMPILER_RT_VISIBILITY;
+extern __llvm_profile_data PROF_DATA_STOP COMPILER_RT_VISIBILITY;
+extern uint64_t PROF_CNTS_START COMPILER_RT_VISIBILITY;
+extern uint64_t PROF_CNTS_STOP COMPILER_RT_VISIBILITY;
+extern char PROF_NAME_START COMPILER_RT_VISIBILITY;
+extern char PROF_NAME_STOP COMPILER_RT_VISIBILITY;
 
 /* Add dummy data to ensure the section is always created. */
 __llvm_profile_data
-    __prof_data_sect_data[0] LLVM_SECTION(INSTR_PROF_DATA_SECT_NAME_STR);
-uint64_t __prof_cnts_sect_data[0] LLVM_SECTION(INSTR_PROF_CNTS_SECT_NAME_STR);
-char __prof_nms_sect_data[0] LLVM_SECTION(INSTR_PROF_NAME_SECT_NAME_STR);
+    __prof_data_sect_data[0] COMPILER_RT_SECTION(INSTR_PROF_DATA_SECT_NAME_STR);
+uint64_t
+    __prof_cnts_sect_data[0] COMPILER_RT_SECTION(INSTR_PROF_CNTS_SECT_NAME_STR);
+char __prof_nms_sect_data[0] COMPILER_RT_SECTION(INSTR_PROF_NAME_SECT_NAME_STR);
 
-LLVM_LIBRARY_VISIBILITY const __llvm_profile_data *
+COMPILER_RT_VISIBILITY const __llvm_profile_data *
 __llvm_profile_begin_data(void) {
   return &PROF_DATA_START;
 }
-LLVM_LIBRARY_VISIBILITY const __llvm_profile_data *
+COMPILER_RT_VISIBILITY const __llvm_profile_data *
 __llvm_profile_end_data(void) {
   return &PROF_DATA_STOP;
 }
-LLVM_LIBRARY_VISIBILITY const char *__llvm_profile_begin_names(void) {
+COMPILER_RT_VISIBILITY const char *__llvm_profile_begin_names(void) {
   return &PROF_NAME_START;
 }
-LLVM_LIBRARY_VISIBILITY const char *__llvm_profile_end_names(void) {
+COMPILER_RT_VISIBILITY const char *__llvm_profile_end_names(void) {
   return &PROF_NAME_STOP;
 }
-LLVM_LIBRARY_VISIBILITY uint64_t *__llvm_profile_begin_counters(void) {
+COMPILER_RT_VISIBILITY uint64_t *__llvm_profile_begin_counters(void) {
   return &PROF_CNTS_START;
 }
-LLVM_LIBRARY_VISIBILITY uint64_t *__llvm_profile_end_counters(void) {
+COMPILER_RT_VISIBILITY uint64_t *__llvm_profile_end_counters(void) {
   return &PROF_CNTS_STOP;
 }
 #endif

Modified: compiler-rt/trunk/lib/profile/InstrProfilingPlatformOther.c
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/profile/InstrProfilingPlatformOther.c?rev=255748&r1=255747&r2=255748&view=diff
==============================================================================
--- compiler-rt/trunk/lib/profile/InstrProfilingPlatformOther.c (original)
+++ compiler-rt/trunk/lib/profile/InstrProfilingPlatformOther.c Tue Dec 15 21:29:15 2015
@@ -26,7 +26,7 @@ static uint64_t *CountersLast = NULL;
  * calls are only required (and only emitted) on targets where we haven't
  * implemented linker magic to find the bounds of the sections.
  */
-LLVM_LIBRARY_VISIBILITY
+COMPILER_RT_VISIBILITY
 void __llvm_profile_register_function(void *Data_) {
   /* TODO: Only emit this function if we can't use linker magic. */
   const __llvm_profile_data *Data = (__llvm_profile_data *)Data_;
@@ -55,16 +55,16 @@ void __llvm_profile_register_function(vo
 #undef UPDATE_LAST
 }
 
-LLVM_LIBRARY_VISIBILITY
+COMPILER_RT_VISIBILITY
 const __llvm_profile_data *__llvm_profile_begin_data(void) { return DataFirst; }
-LLVM_LIBRARY_VISIBILITY
+COMPILER_RT_VISIBILITY
 const __llvm_profile_data *__llvm_profile_end_data(void) { return DataLast; }
-LLVM_LIBRARY_VISIBILITY
+COMPILER_RT_VISIBILITY
 const char *__llvm_profile_begin_names(void) { return NamesFirst; }
-LLVM_LIBRARY_VISIBILITY
+COMPILER_RT_VISIBILITY
 const char *__llvm_profile_end_names(void) { return NamesLast; }
-LLVM_LIBRARY_VISIBILITY
+COMPILER_RT_VISIBILITY
 uint64_t *__llvm_profile_begin_counters(void) { return CountersFirst; }
-LLVM_LIBRARY_VISIBILITY
+COMPILER_RT_VISIBILITY
 uint64_t *__llvm_profile_end_counters(void) { return CountersLast; }
 #endif

Modified: compiler-rt/trunk/lib/profile/InstrProfilingPort.h
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/profile/InstrProfilingPort.h?rev=255748&r1=255747&r2=255748&view=diff
==============================================================================
--- compiler-rt/trunk/lib/profile/InstrProfilingPort.h (original)
+++ compiler-rt/trunk/lib/profile/InstrProfilingPort.h Tue Dec 15 21:29:15 2015
@@ -11,28 +11,29 @@
 #define PROFILE_INSTRPROFILING_PORT_H_
 
 #ifdef _MSC_VER
-#define LLVM_ALIGNAS(x) __declspec(align(x))
-#define LLVM_LIBRARY_VISIBILITY
-#define LLVM_LIBRARY_WEAK __declspec(selectany)
+#define COMPILER_RTLIGNAS(x) __declspec(align(x))
+#define COMPILER_RT_VISIBILITY
+#define COMPILER_RT_WEAK __declspec(selectany)
 #elif __GNUC__
-#define LLVM_ALIGNAS(x) __attribute__((aligned(x)))
-#define LLVM_LIBRARY_VISIBILITY __attribute__((visibility("hidden")))
-#define LLVM_LIBRARY_WEAK __attribute__((weak))
+#define COMPILER_RT_ALIGNAS(x) __attribute__((aligned(x)))
+#define COMPILER_RT_VISIBILITY __attribute__((visibility("hidden")))
+#define COMPILER_RT_WEAK __attribute__((weak))
 #endif
 
-#define LLVM_SECTION(Sect) __attribute__((section(Sect)))
-
-#define PROF_ERR(Format, ...)                                                  \
-  if (GetEnvHook && GetEnvHook("LLVM_PROFILE_VERBOSE_ERRORS"))                 \
-    fprintf(stderr, Format, __VA_ARGS__);
+#define COMPILER_RT_SECTION(Sect) __attribute__((section(Sect)))
 
 #if COMPILER_RT_HAS_ATOMICS == 1
-#define BOOL_CMPXCHG(Ptr, OldV, NewV)                                          \
+#define COMPILER_RT_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)
+#define COMPILER_RT_BOOL_CMPXCHG(Ptr, OldV, NewV)                              \
+  BoolCmpXchg((void **)Ptr, OldV, NewV)
 #endif
 
+#define PROF_ERR(Format, ...)                                                  \
+  if (GetEnvHook && GetEnvHook("LLVM_PROFILE_VERBOSE_ERRORS"))                 \
+    fprintf(stderr, Format, __VA_ARGS__);
+
 #if defined(__FreeBSD__) && defined(__i386__)
 
 /* System headers define 'size_t' incorrectly on x64 FreeBSD (prior to

Modified: compiler-rt/trunk/lib/profile/InstrProfilingRuntime.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/profile/InstrProfilingRuntime.cc?rev=255748&r1=255747&r2=255748&view=diff
==============================================================================
--- compiler-rt/trunk/lib/profile/InstrProfilingRuntime.cc (original)
+++ compiler-rt/trunk/lib/profile/InstrProfilingRuntime.cc Tue Dec 15 21:29:15 2015
@@ -11,7 +11,7 @@ extern "C" {
 
 #include "InstrProfiling.h"
 
-LLVM_LIBRARY_VISIBILITY int __llvm_profile_runtime;
+COMPILER_RT_VISIBILITY int __llvm_profile_runtime;
 }
 
 namespace {

Modified: compiler-rt/trunk/lib/profile/InstrProfilingUtil.c
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/profile/InstrProfilingUtil.c?rev=255748&r1=255747&r2=255748&view=diff
==============================================================================
--- compiler-rt/trunk/lib/profile/InstrProfilingUtil.c (original)
+++ compiler-rt/trunk/lib/profile/InstrProfilingUtil.c Tue Dec 15 21:29:15 2015
@@ -19,7 +19,7 @@ int mkdir(const char*, unsigned short);
 #include <sys/types.h>
 #endif
 
-LLVM_LIBRARY_VISIBILITY
+COMPILER_RT_VISIBILITY
 void __llvm_profile_recursive_mkdir(char *path) {
   int i;
 

Modified: compiler-rt/trunk/lib/profile/InstrProfilingValue.c
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/profile/InstrProfilingValue.c?rev=255748&r1=255747&r2=255748&view=diff
==============================================================================
--- compiler-rt/trunk/lib/profile/InstrProfilingValue.c (original)
+++ compiler-rt/trunk/lib/profile/InstrProfilingValue.c Tue Dec 15 21:29:15 2015
@@ -25,7 +25,7 @@
   }
 
 #if COMPILER_RT_HAS_ATOMICS != 1
-LLVM_LIBRARY_VISIBILITY
+COMPILER_RT_VISIBILITY
 uint32_t BoolCmpXchg(void **Ptr, void *OldV, void *NewV) {
   void *R = *Ptr;
   if (R == OldV) {
@@ -37,20 +37,20 @@ uint32_t BoolCmpXchg(void **Ptr, void *O
 #endif
 
 /* This method is only used in value profiler mock testing.  */
-LLVM_LIBRARY_VISIBILITY void
+COMPILER_RT_VISIBILITY void
 __llvm_profile_set_num_value_sites(__llvm_profile_data *Data,
                                    uint32_t ValueKind, uint16_t NumValueSites) {
   *((uint16_t *)&Data->NumValueSites[ValueKind]) = NumValueSites;
 }
 
 /* This method is only used in value profiler mock testing.  */
-LLVM_LIBRARY_VISIBILITY const __llvm_profile_data *
+COMPILER_RT_VISIBILITY const __llvm_profile_data *
 __llvm_profile_iterate_data(const __llvm_profile_data *Data) {
   return Data + 1;
 }
 
 /* This method is only used in value profiler mock testing.  */
-LLVM_LIBRARY_VISIBILITY void *
+COMPILER_RT_VISIBILITY void *
 __llvm_get_function_addr(const __llvm_profile_data *Data) {
   return Data->FunctionPointer;
 }
@@ -71,7 +71,7 @@ static int allocateValueProfileCounters(
       (ValueProfNode **)calloc(NumVSites, sizeof(ValueProfNode *));
   if (!Mem)
     return 0;
-  if (!BOOL_CMPXCHG(&Data->Values, 0, Mem)) {
+  if (!COMPILER_RT_BOOL_CMPXCHG(&Data->Values, 0, Mem)) {
     free(Mem);
     return 0;
   }
@@ -96,7 +96,7 @@ static void deallocateValueProfileCounte
   free(Data->Values);
 }
 
-LLVM_LIBRARY_VISIBILITY void
+COMPILER_RT_VISIBILITY void
 __llvm_profile_instrument_target(uint64_t TargetValue, void *Data,
                                  uint32_t CounterIndex) {
 
@@ -136,9 +136,10 @@ __llvm_profile_instrument_target(uint64_
 
   uint32_t Success = 0;
   if (!ValueCounters[CounterIndex])
-    Success = BOOL_CMPXCHG(&ValueCounters[CounterIndex], 0, CurrentVNode);
+    Success =
+        COMPILER_RT_BOOL_CMPXCHG(&ValueCounters[CounterIndex], 0, CurrentVNode);
   else if (PrevVNode && !PrevVNode->Next)
-    Success = BOOL_CMPXCHG(&(PrevVNode->Next), 0, CurrentVNode);
+    Success = COMPILER_RT_BOOL_CMPXCHG(&(PrevVNode->Next), 0, CurrentVNode);
 
   if (!Success) {
     free(CurrentVNode);
@@ -167,7 +168,7 @@ static unsigned getVprofExtraBytes() {
 
 #define DTOR_VALUE_RECORD(R) finalizeValueProfRuntimeRecord(&R);
 
-LLVM_LIBRARY_VISIBILITY uint64_t
+COMPILER_RT_VISIBILITY uint64_t
 __llvm_profile_gather_value_data(uint8_t **VDataArray) {
   size_t S = 0, RealSize = 0, BufferCapacity = 0, Extra = 0;
   __llvm_profile_data *I;

Modified: compiler-rt/trunk/lib/profile/InstrProfilingWriter.c
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/profile/InstrProfilingWriter.c?rev=255748&r1=255747&r2=255748&view=diff
==============================================================================
--- compiler-rt/trunk/lib/profile/InstrProfilingWriter.c (original)
+++ compiler-rt/trunk/lib/profile/InstrProfilingWriter.c Tue Dec 15 21:29:15 2015
@@ -10,10 +10,10 @@
 #include "InstrProfiling.h"
 #include "InstrProfilingInternal.h"
 
-LLVM_LIBRARY_VISIBILITY int llvmWriteProfData(WriterCallback Writer,
-                                              void *WriterCtx,
-                                              const uint8_t *ValueDataBegin,
-                                              const uint64_t ValueDataSize) {
+COMPILER_RT_VISIBILITY int llvmWriteProfData(WriterCallback Writer,
+                                             void *WriterCtx,
+                                             const uint8_t *ValueDataBegin,
+                                             const uint64_t ValueDataSize) {
   /* Match logic in __llvm_profile_write_buffer(). */
   const __llvm_profile_data *DataBegin = __llvm_profile_begin_data();
   const __llvm_profile_data *DataEnd = __llvm_profile_end_data();
@@ -26,7 +26,7 @@ LLVM_LIBRARY_VISIBILITY int llvmWritePro
                                ValueDataSize, NamesBegin, NamesEnd);
 }
 
-LLVM_LIBRARY_VISIBILITY int llvmWriteProfDataImpl(
+COMPILER_RT_VISIBILITY int llvmWriteProfDataImpl(
     WriterCallback Writer, void *WriterCtx,
     const __llvm_profile_data *DataBegin, const __llvm_profile_data *DataEnd,
     const uint64_t *CountersBegin, const uint64_t *CountersEnd,




More information about the llvm-commits mailing list