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