summaryrefslogtreecommitdiffstats
path: root/compiler-rt/lib/profile/InstrProfilingPlatformDarwin.c
diff options
context:
space:
mode:
authorDuncan P. N. Exon Smith <dexonsmith@apple.com>2014-03-20 18:43:09 +0000
committerDuncan P. N. Exon Smith <dexonsmith@apple.com>2014-03-20 18:43:09 +0000
commit9cee5e0e92e34348ca9a798c81b51a3497154e3f (patch)
tree9399f350175ce54d8b00ad3d25244e25b9254e89 /compiler-rt/lib/profile/InstrProfilingPlatformDarwin.c
parenta5f804a7eaad5e2727fc0132c5ed15538502b462 (diff)
downloadbcm5719-llvm-9cee5e0e92e34348ca9a798c81b51a3497154e3f.tar.gz
bcm5719-llvm-9cee5e0e92e34348ca9a798c81b51a3497154e3f.zip
PGO: Moving files for clarity
<rdar://problem/15943240> llvm-svn: 204373
Diffstat (limited to 'compiler-rt/lib/profile/InstrProfilingPlatformDarwin.c')
-rw-r--r--compiler-rt/lib/profile/InstrProfilingPlatformDarwin.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/compiler-rt/lib/profile/InstrProfilingPlatformDarwin.c b/compiler-rt/lib/profile/InstrProfilingPlatformDarwin.c
new file mode 100644
index 00000000000..de388ee5ebd
--- /dev/null
+++ b/compiler-rt/lib/profile/InstrProfilingPlatformDarwin.c
@@ -0,0 +1,25 @@
+/*===- InstrProfilingDarwin.c - Profile data on Darwin --------------------===*\
+|*
+|* The LLVM Compiler Infrastructure
+|*
+|* This file is distributed under the University of Illinois Open Source
+|* License. See LICENSE.TXT for details.
+|*
+\*===----------------------------------------------------------------------===*/
+
+#include "InstrProfiling.h"
+
+/* Use linker magic to find the bounds of the Data section. */
+extern __llvm_pgo_data DataStart __asm("section$start$__DATA$__llvm_pgo_data");
+extern __llvm_pgo_data DataEnd __asm("section$end$__DATA$__llvm_pgo_data");
+extern char NamesStart __asm("section$start$__DATA$__llvm_pgo_names");
+extern char NamesEnd __asm("section$end$__DATA$__llvm_pgo_names");
+extern uint64_t CountersStart __asm("section$start$__DATA$__llvm_pgo_cnts");
+extern uint64_t CountersEnd __asm("section$end$__DATA$__llvm_pgo_cnts");
+
+const __llvm_pgo_data *__llvm_pgo_data_begin() { return &DataStart; }
+const __llvm_pgo_data *__llvm_pgo_data_end() { return &DataEnd; }
+const char *__llvm_pgo_names_begin() { return &NamesStart; }
+const char *__llvm_pgo_names_end() { return &NamesEnd; }
+const uint64_t *__llvm_pgo_counters_begin() { return &CountersStart; }
+const uint64_t *__llvm_pgo_counters_end() { return &CountersEnd; }
OpenPOWER on IntegriCloud