[PATCH] D14692: [PGO] Refactor common profile dumping code for File and Buffer API

David Li via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 16 10:55:42 PST 2015


davidxl marked 3 inline comments as done.

================
Comment at: lib/profile/InstrProfilingBuffer.c:44
@@ -44,12 +43,3 @@
 
-__attribute__((visibility("hidden")))
-int __llvm_profile_write_buffer(char *Buffer) {
-  /* Match logic in __llvm_profile_get_size_for_buffer().
-   * Match logic in __llvm_profile_write_file().
-   */
-  const __llvm_profile_data *DataBegin = __llvm_profile_begin_data();
-  const __llvm_profile_data *DataEnd = __llvm_profile_end_data();
-  const uint64_t *CountersBegin = __llvm_profile_begin_counters();
-  const uint64_t *CountersEnd   = __llvm_profile_end_counters();
-  const char *NamesBegin = __llvm_profile_begin_names();
-  const char *NamesEnd   = __llvm_profile_end_names();
+static size_t BufferWriter(const void *Data, size_t ElmS, size_t NumElm,
+                           void **Buffer) {
----------------
vsk wrote:
> vsk wrote:
> > `ElmS` -> `ElmSize`?
> C code in compiler-rt looks like it uses all lowercase and "_" separators in function names. We should preserve that style.
yes public C APIs are all lower cases, but these two new functions are internal APIs (just like existing functions like writeFile etc).  They have global linkage mainly because the cross module references. 


http://reviews.llvm.org/D14692





More information about the llvm-commits mailing list