InstrProfilingPlatformDarwin.c revision 276789
1/*===- InstrProfilingPlatformDarwin.c - Profile data on Darwin ------------===*\ 2|* 3|* The LLVM Compiler Infrastructure 4|* 5|* This file is distributed under the University of Illinois Open Source 6|* License. See LICENSE.TXT for details. 7|* 8\*===----------------------------------------------------------------------===*/ 9 10#include "InstrProfiling.h" 11 12#if defined(__APPLE__) 13/* Use linker magic to find the bounds of the Data section. */ 14__attribute__((visibility("hidden"))) 15extern __llvm_profile_data DataStart __asm("section$start$__DATA$__llvm_prf_data"); 16__attribute__((visibility("hidden"))) 17extern __llvm_profile_data DataEnd __asm("section$end$__DATA$__llvm_prf_data"); 18__attribute__((visibility("hidden"))) 19extern char NamesStart __asm("section$start$__DATA$__llvm_prf_names"); 20__attribute__((visibility("hidden"))) 21extern char NamesEnd __asm("section$end$__DATA$__llvm_prf_names"); 22__attribute__((visibility("hidden"))) 23extern uint64_t CountersStart __asm("section$start$__DATA$__llvm_prf_cnts"); 24__attribute__((visibility("hidden"))) 25extern uint64_t CountersEnd __asm("section$end$__DATA$__llvm_prf_cnts"); 26 27__attribute__((visibility("hidden"))) 28const __llvm_profile_data *__llvm_profile_begin_data(void) { 29 return &DataStart; 30} 31__attribute__((visibility("hidden"))) 32const __llvm_profile_data *__llvm_profile_end_data(void) { 33 return &DataEnd; 34} 35__attribute__((visibility("hidden"))) 36const char *__llvm_profile_begin_names(void) { return &NamesStart; } 37__attribute__((visibility("hidden"))) 38const char *__llvm_profile_end_names(void) { return &NamesEnd; } 39__attribute__((visibility("hidden"))) 40uint64_t *__llvm_profile_begin_counters(void) { return &CountersStart; } 41__attribute__((visibility("hidden"))) 42uint64_t *__llvm_profile_end_counters(void) { return &CountersEnd; } 43#endif 44