2014-03-22 02:29:15 +08:00
|
|
|
/*===- InstrProfilingPlatformDarwin.c - Profile data on Darwin ------------===*\
|
2014-03-20 11:57:33 +08:00
|
|
|
|*
|
2019-01-19 16:50:56 +08:00
|
|
|
|* Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
|
|
|
|* See https://llvm.org/LICENSE.txt for license information.
|
|
|
|
|* SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
2014-03-20 11:57:33 +08:00
|
|
|
|*
|
|
|
|
\*===----------------------------------------------------------------------===*/
|
|
|
|
|
2020-07-30 08:22:27 +08:00
|
|
|
// Note: This is linked into the Darwin kernel, and must remain compatible
|
|
|
|
// with freestanding compilation. See `darwin_add_builtin_libraries`.
|
|
|
|
|
2014-03-20 11:57:33 +08:00
|
|
|
#include "InstrProfiling.h"
|
2021-05-07 00:09:12 +08:00
|
|
|
#include "InstrProfilingInternal.h"
|
2014-03-20 11:57:33 +08:00
|
|
|
|
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
|
2019-02-09 04:37:40 +08:00
|
|
|
DataStart __asm("section$start$__DATA$" INSTR_PROF_DATA_SECT_NAME);
|
2015-12-16 11:29:15 +08:00
|
|
|
COMPILER_RT_VISIBILITY
|
2015-11-24 03:48:25 +08:00
|
|
|
extern __llvm_profile_data
|
2019-02-09 04:37:40 +08:00
|
|
|
DataEnd __asm("section$end$__DATA$" INSTR_PROF_DATA_SECT_NAME);
|
2015-12-16 11:29:15 +08:00
|
|
|
COMPILER_RT_VISIBILITY
|
2015-11-24 03:48:25 +08:00
|
|
|
extern char
|
2019-02-09 04:37:40 +08:00
|
|
|
NamesStart __asm("section$start$__DATA$" INSTR_PROF_NAME_SECT_NAME);
|
2015-12-16 11:29:15 +08:00
|
|
|
COMPILER_RT_VISIBILITY
|
2019-02-09 04:37:40 +08:00
|
|
|
extern char NamesEnd __asm("section$end$__DATA$" INSTR_PROF_NAME_SECT_NAME);
|
2015-12-16 11:29:15 +08:00
|
|
|
COMPILER_RT_VISIBILITY
|
2021-12-30 05:36:28 +08:00
|
|
|
extern char
|
2019-02-09 04:37:40 +08:00
|
|
|
CountersStart __asm("section$start$__DATA$" INSTR_PROF_CNTS_SECT_NAME);
|
2015-12-16 11:29:15 +08:00
|
|
|
COMPILER_RT_VISIBILITY
|
2021-12-30 05:36:28 +08:00
|
|
|
extern char CountersEnd __asm("section$end$__DATA$" INSTR_PROF_CNTS_SECT_NAME);
|
2019-03-08 23:30:56 +08:00
|
|
|
COMPILER_RT_VISIBILITY
|
|
|
|
extern uint32_t
|
|
|
|
OrderFileStart __asm("section$start$__DATA$" INSTR_PROF_ORDERFILE_SECT_NAME);
|
2014-03-20 11:57:33 +08:00
|
|
|
|
2016-05-22 06:55:45 +08:00
|
|
|
COMPILER_RT_VISIBILITY
|
|
|
|
extern ValueProfNode
|
2019-02-09 04:37:40 +08:00
|
|
|
VNodesStart __asm("section$start$__DATA$" INSTR_PROF_VNODES_SECT_NAME);
|
2016-05-22 06:55:45 +08:00
|
|
|
COMPILER_RT_VISIBILITY
|
|
|
|
extern ValueProfNode
|
2019-02-09 04:37:40 +08:00
|
|
|
VNodesEnd __asm("section$end$__DATA$" INSTR_PROF_VNODES_SECT_NAME);
|
2016-05-22 06:55:45 +08:00
|
|
|
|
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
|
2021-12-30 05:36:28 +08:00
|
|
|
char *__llvm_profile_begin_counters(void) { return &CountersStart; }
|
2015-12-16 11:29:15 +08:00
|
|
|
COMPILER_RT_VISIBILITY
|
2021-12-30 05:36:28 +08:00
|
|
|
char *__llvm_profile_end_counters(void) { return &CountersEnd; }
|
2019-03-08 23:30:56 +08:00
|
|
|
COMPILER_RT_VISIBILITY
|
|
|
|
uint32_t *__llvm_profile_begin_orderfile(void) { return &OrderFileStart; }
|
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; }
|
2016-05-23 00:36:03 +08:00
|
|
|
|
|
|
|
COMPILER_RT_VISIBILITY ValueProfNode *CurrentVNode = &VNodesStart;
|
|
|
|
COMPILER_RT_VISIBILITY ValueProfNode *EndVNode = &VNodesEnd;
|
2021-05-07 00:09:12 +08:00
|
|
|
|
|
|
|
COMPILER_RT_VISIBILITY int __llvm_write_binary_ids(ProfDataWriter *Writer) {
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2014-04-23 02:49:32 +08:00
|
|
|
#endif
|