diff options
author | Xinliang David Li <davidxl@google.com> | 2015-11-18 21:08:03 +0000 |
---|---|---|
committer | Xinliang David Li <davidxl@google.com> | 2015-11-18 21:08:03 +0000 |
commit | 82f3febc95e44d30cd414577c77c92b60345bb4b (patch) | |
tree | 5ba0c2d7d140c08993c005556e87686e447ee685 /lib/profile/InstrProfilingInternal.h | |
parent | 4218a0e7a725777a2c786eac6c878541f75db952 (diff) |
[PGO] Refactor File and Buffer API profile writing code
With this change, Buffer API and File API implementations
are unified.
Differential Revision: http://reviews.llvm.org/D14692
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@253500 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/profile/InstrProfilingInternal.h')
-rw-r--r-- | lib/profile/InstrProfilingInternal.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/lib/profile/InstrProfilingInternal.h b/lib/profile/InstrProfilingInternal.h index ede39cd9d..2fa6ea9af 100644 --- a/lib/profile/InstrProfilingInternal.h +++ b/lib/profile/InstrProfilingInternal.h @@ -11,6 +11,7 @@ #define PROFILE_INSTRPROFILING_INTERNALH_ #include "InstrProfiling.h" +#include "stddef.h" /*! * \brief Write instrumentation data to the given buffer, given explicit @@ -37,4 +38,18 @@ int __llvm_profile_write_buffer_internal( const __llvm_profile_data *DataEnd, const uint64_t *CountersBegin, const uint64_t *CountersEnd, const char *NamesBegin, const char *NamesEnd); +/*! + * This is an internal function not intended to be used externally. + */ +typedef size_t (*WriterCallback)(const void *Data, size_t ElmS, size_t NumElm, + void **BufferOrFile); +int llvmWriteProfData(void *BufferOrFile, const uint8_t *ValueDataBegin, const uint64_t ValueDataSize, WriterCallback Writer); +int llvmWriteProfDataImpl(void *BufferOrFile, WriterCallback Writer, + const __llvm_profile_data *DataBegin, + const __llvm_profile_data *DataEnd, + const uint64_t *CountersBegin, const uint64_t *CountersEnd, + const uint8_t *ValueDataBegin, const uint64_t ValueDataSize, + const char *NamesBegin, + const char *NamesEnd); + #endif |