summaryrefslogtreecommitdiff
path: root/lib/profile/InstrProfiling.c
diff options
context:
space:
mode:
authorDuncan P. N. Exon Smith <dexonsmith@apple.com>2014-05-16 01:30:24 +0000
committerDuncan P. N. Exon Smith <dexonsmith@apple.com>2014-05-16 01:30:24 +0000
commitfda7696ffbc58e4485f46a1de85512ee7fb65128 (patch)
treefe3278eb3a7ddf7c31cf82dad734a6a61aec1f80 /lib/profile/InstrProfiling.c
parent3a7550a78bd8f4c9e1eea7002e7ade6deb276d4c (diff)
InstrProf: Fix shared object profiling
Change the API of the instrumented profiling library to work with shared objects. - Most things are now declared hidden, so that each executable gets its own copy. - Initialization hooks up a linked list of writers. - The raw format with shared objects that are profiled consists of a concatenated series of profiles. llvm-profdata knows how to deal with that since r208938. <rdar://problem/16918688> git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@208940 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/profile/InstrProfiling.c')
-rw-r--r--lib/profile/InstrProfiling.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/profile/InstrProfiling.c b/lib/profile/InstrProfiling.c
index 123dd0d3b..aeb3681aa 100644
--- a/lib/profile/InstrProfiling.c
+++ b/lib/profile/InstrProfiling.c
@@ -10,6 +10,7 @@
#include "InstrProfiling.h"
#include <string.h>
+__attribute__((visibility("hidden")))
uint64_t __llvm_profile_get_magic(void) {
/* Magic number to detect file format and endianness.
*
@@ -32,11 +33,13 @@ uint64_t __llvm_profile_get_magic(void) {
(uint64_t)129;
}
+__attribute__((visibility("hidden")))
uint64_t __llvm_profile_get_version(void) {
/* This should be bumped any time the output format changes. */
return 1;
}
+__attribute__((visibility("hidden")))
void __llvm_profile_reset_counters(void) {
uint64_t *I = __llvm_profile_counters_begin();
uint64_t *E = __llvm_profile_counters_end();