2014-03-22 02:29:15 +08:00
|
|
|
/*===- InstrProfilingPlatformDarwin.c - Profile data on Darwin ------------===*\
|
2014-03-20 11:57:33 +08:00
|
|
|
|*
|
|
|
|
|* The LLVM Compiler Infrastructure
|
|
|
|
|*
|
|
|
|
|* This file is distributed under the University of Illinois Open Source
|
|
|
|
|* License. See LICENSE.TXT for details.
|
|
|
|
|*
|
|
|
|
\*===----------------------------------------------------------------------===*/
|
|
|
|
|
|
|
|
#include "InstrProfiling.h"
|
|
|
|
|
2014-04-23 02:49:32 +08:00
|
|
|
#if defined(__APPLE__)
|
2014-03-20 11:57:33 +08:00
|
|
|
/* Use linker magic to find the bounds of the Data section. */
|
2014-05-16 09:30:24 +08:00
|
|
|
__attribute__((visibility("hidden")))
|
2014-03-21 04:00:44 +08:00
|
|
|
extern __llvm_profile_data DataStart __asm("section$start$__DATA$__llvm_prf_data");
|
2014-05-16 09:30:24 +08:00
|
|
|
__attribute__((visibility("hidden")))
|
2014-03-21 04:00:44 +08:00
|
|
|
extern __llvm_profile_data DataEnd __asm("section$end$__DATA$__llvm_prf_data");
|
2014-05-16 09:30:24 +08:00
|
|
|
__attribute__((visibility("hidden")))
|
2014-03-21 04:00:44 +08:00
|
|
|
extern char NamesStart __asm("section$start$__DATA$__llvm_prf_names");
|
2014-05-16 09:30:24 +08:00
|
|
|
__attribute__((visibility("hidden")))
|
2014-03-21 04:00:44 +08:00
|
|
|
extern char NamesEnd __asm("section$end$__DATA$__llvm_prf_names");
|
2014-05-16 09:30:24 +08:00
|
|
|
__attribute__((visibility("hidden")))
|
2014-03-21 04:00:44 +08:00
|
|
|
extern uint64_t CountersStart __asm("section$start$__DATA$__llvm_prf_cnts");
|
2014-05-16 09:30:24 +08:00
|
|
|
__attribute__((visibility("hidden")))
|
2014-03-21 04:00:44 +08:00
|
|
|
extern uint64_t CountersEnd __asm("section$end$__DATA$__llvm_prf_cnts");
|
2014-03-20 11:57:33 +08:00
|
|
|
|
2014-05-16 09:30:24 +08:00
|
|
|
__attribute__((visibility("hidden")))
|
2014-09-04 23:45:31 +08:00
|
|
|
const __llvm_profile_data *__llvm_profile_begin_data(void) {
|
2014-03-21 04:55:00 +08:00
|
|
|
return &DataStart;
|
|
|
|
}
|
2014-05-16 09:30:24 +08:00
|
|
|
__attribute__((visibility("hidden")))
|
2014-09-04 23:45:31 +08:00
|
|
|
const __llvm_profile_data *__llvm_profile_end_data(void) {
|
2014-03-21 04:55:00 +08:00
|
|
|
return &DataEnd;
|
|
|
|
}
|
2014-05-16 09:30:24 +08:00
|
|
|
__attribute__((visibility("hidden")))
|
2014-09-04 23:45:31 +08:00
|
|
|
const char *__llvm_profile_begin_names(void) { return &NamesStart; }
|
2014-05-16 09:30:24 +08:00
|
|
|
__attribute__((visibility("hidden")))
|
2014-09-04 23:45:31 +08:00
|
|
|
const char *__llvm_profile_end_names(void) { return &NamesEnd; }
|
2014-05-16 09:30:24 +08:00
|
|
|
__attribute__((visibility("hidden")))
|
2014-09-04 23:45:31 +08:00
|
|
|
uint64_t *__llvm_profile_begin_counters(void) { return &CountersStart; }
|
2014-05-16 09:30:24 +08:00
|
|
|
__attribute__((visibility("hidden")))
|
2014-09-04 23:45:31 +08:00
|
|
|
uint64_t *__llvm_profile_end_counters(void) { return &CountersEnd; }
|
2014-04-23 02:49:32 +08:00
|
|
|
#endif
|