summaryrefslogtreecommitdiff
path: root/lib/profile/InstrProfilingPlatformDarwin.c
blob: 3150a2392a04d40cbfe9bdc941c91d9bf3b9993f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
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_profile_data DataStart __asm("section$start$__DATA$__llvm_prf_data");
extern __llvm_profile_data DataEnd   __asm("section$end$__DATA$__llvm_prf_data");
extern char NamesStart __asm("section$start$__DATA$__llvm_prf_names");
extern char NamesEnd   __asm("section$end$__DATA$__llvm_prf_names");
extern uint64_t CountersStart __asm("section$start$__DATA$__llvm_prf_cnts");
extern uint64_t CountersEnd   __asm("section$end$__DATA$__llvm_prf_cnts");

const __llvm_profile_data *__llvm_profile_data_begin() { return &DataStart; }
const __llvm_profile_data *__llvm_profile_data_end()   { return &DataEnd; }
const char *__llvm_profile_names_begin() { return &NamesStart; }
const char *__llvm_profile_names_end()   { return &NamesEnd; }
uint64_t *__llvm_profile_counters_begin() { return &CountersStart; }
uint64_t *__llvm_profile_counters_end()   { return &CountersEnd; }