Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 5 additions & 9 deletions clang/lib/Driver/ToolChains/Darwin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1481,15 +1481,11 @@ void Darwin::addProfileRTLibs(const ArgList &Args,
// If we have a symbol export directive and we're linking in the profile
// runtime, automatically export symbols necessary to implement some of the
// runtime's functionality.
if (hasExportSymbolDirective(Args)) {
if (ForGCOV) {
addExportedSymbol(CmdArgs, "___gcov_dump");
addExportedSymbol(CmdArgs, "___gcov_reset");
addExportedSymbol(CmdArgs, "_writeout_fn_list");
addExportedSymbol(CmdArgs, "_reset_fn_list");
} else {
addExportedSymbol(CmdArgs, "___llvm_write_custom_profile");
}
if (hasExportSymbolDirective(Args) && ForGCOV) {
addExportedSymbol(CmdArgs, "___gcov_dump");
addExportedSymbol(CmdArgs, "___gcov_reset");
addExportedSymbol(CmdArgs, "_writeout_fn_list");
addExportedSymbol(CmdArgs, "_reset_fn_list");
}

// Align __llvm_prf_{cnts,bits,data} sections to the maximum expected page
Expand Down
12 changes: 5 additions & 7 deletions compiler-rt/lib/profile/InstrProfilingFile.c
Original file line number Diff line number Diff line change
Expand Up @@ -1273,13 +1273,11 @@ COMPILER_RT_VISIBILITY int __llvm_profile_set_file_object(FILE *File,
return 0;
}

int __llvm_write_custom_profile(const char *Target,
const __llvm_profile_data *DataBegin,
const __llvm_profile_data *DataEnd,
const char *CountersBegin,
const char *CountersEnd, const char *NamesBegin,
const char *NamesEnd,
const uint64_t *VersionOverride) {
COMPILER_RT_GPU_ENTRYPOINT int __llvm_write_custom_profile(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would probably be more straightforward to just ifdef this whole block out on apple.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed, that's probably easier and less invasive.

const char *Target, const __llvm_profile_data *DataBegin,
const __llvm_profile_data *DataEnd, const char *CountersBegin,
const char *CountersEnd, const char *NamesBegin, const char *NamesEnd,
const uint64_t *VersionOverride) {
int ReturnValue = 0, FilenameLength, TargetLength;
char *FilenameBuf, *TargetFilename;
const char *Filename;
Expand Down
2 changes: 2 additions & 0 deletions compiler-rt/lib/profile/InstrProfilingPort.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,10 @@

#if defined(__APPLE__)
#define COMPILER_RT_SEG "__DATA,"
#define COMPILER_RT_GPU_ENTRYPOINT COMPILER_RT_VISIBILITY
#else
#define COMPILER_RT_SEG ""
#define COMPILER_RT_GPU_ENTRYPOINT
#endif

#ifdef _MSC_VER
Expand Down