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. */
|
2015-12-16 11:29:15 +08:00
|
|
|
COMPILER_RT_VISIBILITY
|
2015-11-23 12:38:17 +08:00
|
|
|
extern __llvm_profile_data
|
2015-11-24 03:48:25 +08:00
|
|
|
DataStart __asm("section$start$__DATA$" INSTR_PROF_DATA_SECT_NAME_STR);
|
2015-12-16 11:29:15 +08:00
|
|
|
COMPILER_RT_VISIBILITY
|
2015-11-24 03:48:25 +08:00
|
|
|
extern __llvm_profile_data
|
|
|
|
DataEnd __asm("section$end$__DATA$" INSTR_PROF_DATA_SECT_NAME_STR);
|
2015-12-16 11:29:15 +08:00
|
|
|
COMPILER_RT_VISIBILITY
|
2015-11-24 03:48:25 +08:00
|
|
|
extern char
|
|
|
|
NamesStart __asm("section$start$__DATA$" INSTR_PROF_NAME_SECT_NAME_STR);
|
2015-12-16 11:29:15 +08:00
|
|
|
COMPILER_RT_VISIBILITY
|
2015-11-24 03:48:25 +08:00
|
|
|
extern char NamesEnd __asm("section$end$__DATA$" INSTR_PROF_NAME_SECT_NAME_STR);
|
2015-12-16 11:29:15 +08:00
|
|
|
COMPILER_RT_VISIBILITY
|
2015-11-24 03:48:25 +08:00
|
|
|
extern uint64_t
|
|
|
|
CountersStart __asm("section$start$__DATA$" INSTR_PROF_CNTS_SECT_NAME_STR);
|
2015-12-16 11:29:15 +08:00
|
|
|
COMPILER_RT_VISIBILITY
|
2015-11-24 03:48:25 +08:00
|
|
|
extern uint64_t
|
|
|
|
CountersEnd __asm("section$end$__DATA$" INSTR_PROF_CNTS_SECT_NAME_STR);
|
2014-03-20 11:57:33 +08:00
|
|
|
|
2016-05-22 06:55:45 +08:00
|
|
|
COMPILER_RT_VISIBILITY
|
|
|
|
extern ValueProfNode
|
2016-05-22 07:27:18 +08:00
|
|
|
VNodesStart __asm("section$start$__DATA$" INSTR_PROF_VNODES_SECT_NAME_STR);
|
2016-05-22 06:55:45 +08:00
|
|
|
COMPILER_RT_VISIBILITY
|
|
|
|
extern ValueProfNode
|
|
|
|
VNodesEnd __asm("section$end$__DATA$" INSTR_PROF_VNODES_SECT_NAME_STR);
|
|
|
|
|
2015-12-16 11:29:15 +08:00
|
|
|
COMPILER_RT_VISIBILITY
|
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;
|
|
|
|
}
|
2015-12-16 11:29:15 +08:00
|
|
|
COMPILER_RT_VISIBILITY
|
2015-11-23 12:38:17 +08:00
|
|
|
const __llvm_profile_data *__llvm_profile_end_data(void) { return &DataEnd; }
|
2015-12-16 11:29:15 +08:00
|
|
|
COMPILER_RT_VISIBILITY
|
2014-09-04 23:45:31 +08:00
|
|
|
const char *__llvm_profile_begin_names(void) { return &NamesStart; }
|
2015-12-16 11:29:15 +08:00
|
|
|
COMPILER_RT_VISIBILITY
|
2014-09-04 23:45:31 +08:00
|
|
|
const char *__llvm_profile_end_names(void) { return &NamesEnd; }
|
2015-12-16 11:29:15 +08:00
|
|
|
COMPILER_RT_VISIBILITY
|
2014-09-04 23:45:31 +08:00
|
|
|
uint64_t *__llvm_profile_begin_counters(void) { return &CountersStart; }
|
2015-12-16 11:29:15 +08:00
|
|
|
COMPILER_RT_VISIBILITY
|
2014-09-04 23:45:31 +08:00
|
|
|
uint64_t *__llvm_profile_end_counters(void) { return &CountersEnd; }
|
2016-05-22 06:55:45 +08:00
|
|
|
|
|
|
|
COMPILER_RT_VISIBILITY
|
|
|
|
ValueProfNode *__llvm_profile_begin_vnodes(void) {
|
|
|
|
return &VNodesStart;
|
|
|
|
}
|
|
|
|
COMPILER_RT_VISIBILITY
|
2016-05-22 07:06:39 +08:00
|
|
|
ValueProfNode *__llvm_profile_end_vnodes(void) { return &VNodesEnd; }
|
2014-04-23 02:49:32 +08:00
|
|
|
#endif
|