profile: Avoid name collisions between instrumentation and runtime
The naming scheme we're using for counters in profile data shares a
prefix with some fixed names we use for the runtime, notably
__llvm_profile_data_begin and _end. Embarrassingly, this means a
function called begin() can't be instrumented.
This modifies the runtime names so as not to collide with the
instrumentation.
llvm-svn: 217166
diff --git a/compiler-rt/lib/profile/InstrProfilingFile.c b/compiler-rt/lib/profile/InstrProfilingFile.c
index 5fb78e3..5aef390 100644
--- a/compiler-rt/lib/profile/InstrProfilingFile.c
+++ b/compiler-rt/lib/profile/InstrProfilingFile.c
@@ -16,12 +16,12 @@
static int writeFile(FILE *File) {
/* Match logic in __llvm_profile_write_buffer(). */
- const __llvm_profile_data *DataBegin = __llvm_profile_data_begin();
- const __llvm_profile_data *DataEnd = __llvm_profile_data_end();
- const uint64_t *CountersBegin = __llvm_profile_counters_begin();
- const uint64_t *CountersEnd = __llvm_profile_counters_end();
- const char *NamesBegin = __llvm_profile_names_begin();
- const char *NamesEnd = __llvm_profile_names_end();
+ 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();
/* Calculate size of sections. */
const uint64_t DataSize = DataEnd - DataBegin;