summaryrefslogtreecommitdiffstats
path: root/compiler-rt/lib
diff options
context:
space:
mode:
authorXinliang David Li <davidxl@google.com>2016-03-06 04:18:13 +0000
committerXinliang David Li <davidxl@google.com>2016-03-06 04:18:13 +0000
commitcf1a8d69129992fbddccffbaf8c2e9d81be51e67 (patch)
tree0962e32ef28d05b5b0ba84cf2510baff9de48684 /compiler-rt/lib
parent32effa19740bba5caaf244f838e3a400469dd83d (diff)
downloadbcm5719-llvm-cf1a8d69129992fbddccffbaf8c2e9d81be51e67.tar.gz
bcm5719-llvm-cf1a8d69129992fbddccffbaf8c2e9d81be51e67.zip
[PGO] internal API name cleanups (for better consistency)
llvm-svn: 262788
Diffstat (limited to 'compiler-rt/lib')
-rw-r--r--compiler-rt/lib/profile/InstrProfilingBuffer.c8
-rw-r--r--compiler-rt/lib/profile/InstrProfilingFile.c18
-rw-r--r--compiler-rt/lib/profile/InstrProfilingInternal.h44
-rw-r--r--compiler-rt/lib/profile/InstrProfilingMergeFile.c6
-rw-r--r--compiler-rt/lib/profile/InstrProfilingPort.h4
-rw-r--r--compiler-rt/lib/profile/InstrProfilingUtil.c2
-rw-r--r--compiler-rt/lib/profile/InstrProfilingWriter.c57
7 files changed, 70 insertions, 69 deletions
diff --git a/compiler-rt/lib/profile/InstrProfilingBuffer.c b/compiler-rt/lib/profile/InstrProfilingBuffer.c
index 1d95534e09e..dcb6929cb0a 100644
--- a/compiler-rt/lib/profile/InstrProfilingBuffer.c
+++ b/compiler-rt/lib/profile/InstrProfilingBuffer.c
@@ -46,14 +46,14 @@ uint64_t __llvm_profile_get_size_for_buffer_internal(
}
COMPILER_RT_VISIBILITY int __llvm_profile_write_buffer(char *Buffer) {
- return llvmWriteProfData(llvmBufferWriter, Buffer, 0, 0);
+ return lprofWriteData(lprofBufferWriter, Buffer, 0, 0);
}
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) {
- return llvmWriteProfDataImpl(llvmBufferWriter, Buffer, DataBegin, DataEnd,
- CountersBegin, CountersEnd, 0, 0, NamesBegin,
- NamesEnd);
+ return lprofWriteDataImpl(lprofBufferWriter, Buffer, DataBegin, DataEnd,
+ CountersBegin, CountersEnd, 0, 0, NamesBegin,
+ NamesEnd);
}
diff --git a/compiler-rt/lib/profile/InstrProfilingFile.c b/compiler-rt/lib/profile/InstrProfilingFile.c
index ad8c3a08a9f..327f4a2bc6f 100644
--- a/compiler-rt/lib/profile/InstrProfilingFile.c
+++ b/compiler-rt/lib/profile/InstrProfilingFile.c
@@ -21,12 +21,12 @@
#define UNCONST(ptr) ((void *)(uintptr_t)(ptr))
#ifdef COMPILER_RT_HAS_UNAME
-int GetHostName(char *Name, int Len) {
- struct utsname N;
- int R;
- if (!(R = uname(&N)))
- strncpy(Name, N.nodename, Len);
- return R;
+int lprofGetHostName(char *Name, int Len) {
+ struct utsname N;
+ int R;
+ if (!(R = uname(&N)))
+ strncpy(Name, N.nodename, Len);
+ return R;
}
#endif
@@ -44,10 +44,10 @@ static uint32_t fileWriter(ProfDataIOVec *IOVecs, uint32_t NumIOVecs,
}
COMPILER_RT_VISIBILITY ProfBufferIO *
-llvmCreateBufferIOInternal(void *File, uint32_t BufferSz) {
+lprofCreateBufferIOInternal(void *File, uint32_t BufferSz) {
CallocHook = calloc;
FreeHook = free;
- return llvmCreateBufferIO(fileWriter, File, BufferSz);
+ return lprofCreateBufferIO(fileWriter, File, BufferSz);
}
static int writeFile(FILE *File) {
@@ -60,7 +60,7 @@ static int writeFile(FILE *File) {
BufferSzStr = getenv("LLVM_VP_BUFFER_SIZE");
if (BufferSzStr && BufferSzStr[0])
VPBufferSize = atoi(BufferSzStr);
- return llvmWriteProfData(fileWriter, File, ValueDataArray, ValueDataSize);
+ return lprofWriteData(fileWriter, File, ValueDataArray, ValueDataSize);
}
static int writeFileWithName(const char *OutputName) {
diff --git a/compiler-rt/lib/profile/InstrProfilingInternal.h b/compiler-rt/lib/profile/InstrProfilingInternal.h
index cd081ae3e0c..2645858fc09 100644
--- a/compiler-rt/lib/profile/InstrProfilingInternal.h
+++ b/compiler-rt/lib/profile/InstrProfilingInternal.h
@@ -68,51 +68,51 @@ typedef struct ProfBufferIO {
} ProfBufferIO;
/* The creator interface used by testing. */
-ProfBufferIO *llvmCreateBufferIOInternal(void *File, uint32_t DefaultBufferSz);
+ProfBufferIO *lprofCreateBufferIOInternal(void *File, uint32_t DefaultBufferSz);
/*!
* This is the interface to create a handle for buffered IO.
*/
-ProfBufferIO *llvmCreateBufferIO(WriterCallback FileWriter, void *File,
- uint32_t DefaultBufferSz);
+ProfBufferIO *lprofCreateBufferIO(WriterCallback FileWriter, void *File,
+ uint32_t DefaultBufferSz);
/*!
* The interface to destroy the bufferIO handle and reclaim
* the memory.
*/
-void llvmDeleteBufferIO(ProfBufferIO *BufferIO);
+void lprofDeleteBufferIO(ProfBufferIO *BufferIO);
/*!
* This is the interface to write \c Data of \c Size bytes through
* \c BufferIO. Returns 0 if successful, otherwise return -1.
*/
-int llvmBufferIOWrite(ProfBufferIO *BufferIO, const uint8_t *Data,
- uint32_t Size);
+int lprofBufferIOWrite(ProfBufferIO *BufferIO, const uint8_t *Data,
+ uint32_t Size);
/*!
* The interface to flush the remaining data in the buffer.
* through the low level writer callback.
*/
-int llvmBufferIOFlush(ProfBufferIO *BufferIO);
+int lprofBufferIOFlush(ProfBufferIO *BufferIO);
/* The low level interface to write data into a buffer. It is used as the
* callback by other high level writer methods such as buffered IO writer
* and profile data writer. */
-uint32_t llvmBufferWriter(ProfDataIOVec *IOVecs, uint32_t NumIOVecs,
- void **WriterCtx);
+uint32_t lprofBufferWriter(ProfDataIOVec *IOVecs, uint32_t NumIOVecs,
+ void **WriterCtx);
-int llvmWriteProfData(WriterCallback Writer, void *WriterCtx,
- struct ValueProfData **ValueDataArray,
- const uint64_t ValueDataSize);
-int llvmWriteProfDataImpl(WriterCallback Writer, void *WriterCtx,
- const __llvm_profile_data *DataBegin,
- const __llvm_profile_data *DataEnd,
- const uint64_t *CountersBegin,
- const uint64_t *CountersEnd,
- struct ValueProfData **ValueDataBeginArray,
- const uint64_t ValueDataSize, const char *NamesBegin,
- const char *NamesEnd);
+int lprofWriteData(WriterCallback Writer, void *WriterCtx,
+ struct ValueProfData **ValueDataArray,
+ const uint64_t ValueDataSize);
+int lprofWriteDataImpl(WriterCallback Writer, void *WriterCtx,
+ const __llvm_profile_data *DataBegin,
+ const __llvm_profile_data *DataEnd,
+ const uint64_t *CountersBegin,
+ const uint64_t *CountersEnd,
+ struct ValueProfData **ValueDataBeginArray,
+ const uint64_t ValueDataSize, const char *NamesBegin,
+ const char *NamesEnd);
/* Merge value profile data pointed to by SrcValueProfData into
* in-memory profile counters pointed by to DstData. */
-void mergeValueProfData(struct ValueProfData *SrcValueProfData,
- __llvm_profile_data *DstData);
+void lprofMergeValueProfData(struct ValueProfData *SrcValueProfData,
+ __llvm_profile_data *DstData);
extern char *(*GetEnvHook)(const char *);
extern void (*FreeHook)(void *);
diff --git a/compiler-rt/lib/profile/InstrProfilingMergeFile.c b/compiler-rt/lib/profile/InstrProfilingMergeFile.c
index bfcca8fc9cb..ac5ee9fbedc 100644
--- a/compiler-rt/lib/profile/InstrProfilingMergeFile.c
+++ b/compiler-rt/lib/profile/InstrProfilingMergeFile.c
@@ -18,12 +18,12 @@
#include "InstrProfData.inc"
void (*VPMergeHook)(ValueProfData *,
- __llvm_profile_data *) = &mergeValueProfData;
+ __llvm_profile_data *) = &lprofMergeValueProfData;
/* Merge value profile data pointed to by SrcValueProfData into
* in-memory profile counters pointed by to DstData. */
-void mergeValueProfData(ValueProfData *SrcValueProfData,
- __llvm_profile_data *DstData) {
+void lprofMergeValueProfData(ValueProfData *SrcValueProfData,
+ __llvm_profile_data *DstData) {
unsigned I, S, V, C;
InstrProfValueData *VData;
ValueProfRecord *VR = getFirstValueProfRecord(SrcValueProfData);
diff --git a/compiler-rt/lib/profile/InstrProfilingPort.h b/compiler-rt/lib/profile/InstrProfilingPort.h
index d6e063e57fe..58e085e90e0 100644
--- a/compiler-rt/lib/profile/InstrProfilingPort.h
+++ b/compiler-rt/lib/profile/InstrProfilingPort.h
@@ -28,7 +28,7 @@
#elif defined(__PS4__)
#define COMPILER_RT_GETHOSTNAME(Name, Len) (-1)
#else
-#define COMPILER_RT_GETHOSTNAME(Name, Len) GetHostName(Name, Len)
+#define COMPILER_RT_GETHOSTNAME(Name, Len) lprofGetHostName(Name, Len)
#define COMPILER_RT_HAS_UNAME 1
#endif
@@ -53,7 +53,7 @@
#endif
#else /* COMPILER_RT_HAS_ATOMICS != 1 */
#define COMPILER_RT_BOOL_CMPXCHG(Ptr, OldV, NewV) \
- BoolCmpXchg((void **)Ptr, OldV, NewV)
+ lprofBoolCmpXchg((void **)Ptr, OldV, NewV)
#endif
#define PROF_ERR(Format, ...) \
diff --git a/compiler-rt/lib/profile/InstrProfilingUtil.c b/compiler-rt/lib/profile/InstrProfilingUtil.c
index b7892d841f1..59b17511ca3 100644
--- a/compiler-rt/lib/profile/InstrProfilingUtil.c
+++ b/compiler-rt/lib/profile/InstrProfilingUtil.c
@@ -37,7 +37,7 @@ void __llvm_profile_recursive_mkdir(char *path) {
#if COMPILER_RT_HAS_ATOMICS != 1
COMPILER_RT_VISIBILITY
-uint32_t BoolCmpXchg(void **Ptr, void *OldV, void *NewV) {
+uint32_t lprofBoolCmpXchg(void **Ptr, void *OldV, void *NewV) {
void *R = *Ptr;
if (R == OldV) {
*Ptr = NewV;
diff --git a/compiler-rt/lib/profile/InstrProfilingWriter.c b/compiler-rt/lib/profile/InstrProfilingWriter.c
index 93879bbc8c1..18b3f34640b 100644
--- a/compiler-rt/lib/profile/InstrProfilingWriter.c
+++ b/compiler-rt/lib/profile/InstrProfilingWriter.c
@@ -20,9 +20,9 @@ uint32_t VPBufferSize = 0;
/* The buffer writer is reponsponsible in keeping writer state
* across the call.
*/
-COMPILER_RT_VISIBILITY uint32_t llvmBufferWriter(ProfDataIOVec *IOVecs,
- uint32_t NumIOVecs,
- void **WriterCtx) {
+COMPILER_RT_VISIBILITY uint32_t lprofBufferWriter(ProfDataIOVec *IOVecs,
+ uint32_t NumIOVecs,
+ void **WriterCtx) {
uint32_t I;
char **Buffer = (char **)WriterCtx;
for (I = 0; I < NumIOVecs; I++) {
@@ -43,7 +43,7 @@ static void llvmInitBufferIO(ProfBufferIO *BufferIO, WriterCallback FileWriter,
}
COMPILER_RT_VISIBILITY ProfBufferIO *
-llvmCreateBufferIO(WriterCallback FileWriter, void *File, uint32_t BufferSz) {
+lprofCreateBufferIO(WriterCallback FileWriter, void *File, uint32_t BufferSz) {
ProfBufferIO *BufferIO = (ProfBufferIO *)CallocHook(1, sizeof(ProfBufferIO));
uint8_t *Buffer = (uint8_t *)CallocHook(1, BufferSz);
if (!Buffer) {
@@ -54,17 +54,17 @@ llvmCreateBufferIO(WriterCallback FileWriter, void *File, uint32_t BufferSz) {
return BufferIO;
}
-COMPILER_RT_VISIBILITY void llvmDeleteBufferIO(ProfBufferIO *BufferIO) {
+COMPILER_RT_VISIBILITY void lprofDeleteBufferIO(ProfBufferIO *BufferIO) {
FreeHook(BufferIO->BufferStart);
FreeHook(BufferIO);
}
COMPILER_RT_VISIBILITY int
-llvmBufferIOWrite(ProfBufferIO *BufferIO, const uint8_t *Data, uint32_t Size) {
+lprofBufferIOWrite(ProfBufferIO *BufferIO, const uint8_t *Data, uint32_t Size) {
/* Buffer is not large enough, it is time to flush. */
if (Size + BufferIO->CurOffset > BufferIO->BufferSz) {
- if (llvmBufferIOFlush(BufferIO) != 0)
- return -1;
+ if (lprofBufferIOFlush(BufferIO) != 0)
+ return -1;
}
/* Special case, bypass the buffer completely. */
ProfDataIOVec IO[] = {{Data, sizeof(uint8_t), Size}};
@@ -74,13 +74,13 @@ llvmBufferIOWrite(ProfBufferIO *BufferIO, const uint8_t *Data, uint32_t Size) {
} else {
/* Write the data to buffer */
uint8_t *Buffer = BufferIO->BufferStart + BufferIO->CurOffset;
- llvmBufferWriter(IO, 1, (void **)&Buffer);
+ lprofBufferWriter(IO, 1, (void **)&Buffer);
BufferIO->CurOffset = Buffer - BufferIO->BufferStart;
}
return 0;
}
-COMPILER_RT_VISIBILITY int llvmBufferIOFlush(ProfBufferIO *BufferIO) {
+COMPILER_RT_VISIBILITY int lprofBufferIOFlush(ProfBufferIO *BufferIO) {
if (BufferIO->CurOffset) {
ProfDataIOVec IO[] = {
{BufferIO->BufferStart, sizeof(uint8_t), BufferIO->CurOffset}};
@@ -91,10 +91,10 @@ COMPILER_RT_VISIBILITY int llvmBufferIOFlush(ProfBufferIO *BufferIO) {
return 0;
}
-COMPILER_RT_VISIBILITY int llvmWriteProfData(WriterCallback Writer,
- void *WriterCtx,
- ValueProfData **ValueDataArray,
- const uint64_t ValueDataSize) {
+COMPILER_RT_VISIBILITY int lprofWriteData(WriterCallback Writer,
+ void *WriterCtx,
+ ValueProfData **ValueDataArray,
+ 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();
@@ -102,9 +102,9 @@ COMPILER_RT_VISIBILITY int llvmWriteProfData(WriterCallback Writer,
const uint64_t *CountersEnd = __llvm_profile_end_counters();
const char *NamesBegin = __llvm_profile_begin_names();
const char *NamesEnd = __llvm_profile_end_names();
- return llvmWriteProfDataImpl(Writer, WriterCtx, DataBegin, DataEnd,
- CountersBegin, CountersEnd, ValueDataArray,
- ValueDataSize, NamesBegin, NamesEnd);
+ return lprofWriteDataImpl(Writer, WriterCtx, DataBegin, DataEnd,
+ CountersBegin, CountersEnd, ValueDataArray,
+ ValueDataSize, NamesBegin, NamesEnd);
}
#define VP_BUFFER_SIZE 8 * 1024
@@ -118,30 +118,31 @@ static int writeValueProfData(WriterCallback Writer, void *WriterCtx,
return 0;
BufferSz = VPBufferSize ? VPBufferSize : VP_BUFFER_SIZE;
- BufferIO = llvmCreateBufferIO(Writer, WriterCtx, BufferSz);
+ BufferIO = lprofCreateBufferIO(Writer, WriterCtx, BufferSz);
for (I = 0; I < NumVData; I++) {
ValueProfData *CurVData = ValueDataBegin[I];
if (!CurVData)
continue;
- if (llvmBufferIOWrite(BufferIO, (const uint8_t *)CurVData,
- CurVData->TotalSize) != 0)
+ if (lprofBufferIOWrite(BufferIO, (const uint8_t *)CurVData,
+ CurVData->TotalSize) != 0)
return -1;
}
- if (llvmBufferIOFlush(BufferIO) != 0)
+ if (lprofBufferIOFlush(BufferIO) != 0)
return -1;
- llvmDeleteBufferIO(BufferIO);
+ lprofDeleteBufferIO(BufferIO);
return 0;
}
-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,
- ValueProfData **ValueDataBegin, const uint64_t ValueDataSize,
- const char *NamesBegin, const char *NamesEnd) {
+COMPILER_RT_VISIBILITY int
+lprofWriteDataImpl(WriterCallback Writer, void *WriterCtx,
+ const __llvm_profile_data *DataBegin,
+ const __llvm_profile_data *DataEnd,
+ const uint64_t *CountersBegin, const uint64_t *CountersEnd,
+ ValueProfData **ValueDataBegin, const uint64_t ValueDataSize,
+ const char *NamesBegin, const char *NamesEnd) {
/* Calculate size of sections. */
const uint64_t DataSize = __llvm_profile_get_data_size(DataBegin, DataEnd);
OpenPOWER on IntegriCloud