summaryrefslogtreecommitdiffstats
path: root/clang
diff options
context:
space:
mode:
authorVedant Kumar <vsk@apple.com>2018-04-13 23:43:59 +0000
committerVedant Kumar <vsk@apple.com>2018-04-13 23:43:59 +0000
commit4dda4b9393d46ba6fb111b6e45d48bd43cc5e31c (patch)
treeaa1751e2aa29623c3169f7f090a9610377e8cba8 /clang
parent1ba8c8a2cc9f797842de2eed791bab01481480bd (diff)
downloadbcm5719-llvm-4dda4b9393d46ba6fb111b6e45d48bd43cc5e31c.tar.gz
bcm5719-llvm-4dda4b9393d46ba6fb111b6e45d48bd43cc5e31c.zip
[Driver] Export profiling symbols for -exported_symbols_list
When profiling is enabled and -exported_symbols_list is specified for the Darwin linker, export the requisite set of profiling symbols. rdar://39427167 llvm-svn: 330077
Diffstat (limited to 'clang')
-rw-r--r--clang/lib/Driver/ToolChains/Darwin.cpp2
-rw-r--r--clang/test/Driver/darwin-ld.c2
2 files changed, 4 insertions, 0 deletions
diff --git a/clang/lib/Driver/ToolChains/Darwin.cpp b/clang/lib/Driver/ToolChains/Darwin.cpp
index 70db1dda205..2c1234c83ab 100644
--- a/clang/lib/Driver/ToolChains/Darwin.cpp
+++ b/clang/lib/Driver/ToolChains/Darwin.cpp
@@ -988,6 +988,8 @@ StringRef Darwin::getOSLibraryNameSuffix() const {
/// Check if the link command contains a symbol export directive.
static bool hasExportSymbolDirective(const ArgList &Args) {
for (Arg *A : Args) {
+ if (A->getOption().matches(options::OPT_exported__symbols__list))
+ return true;
if (!A->getOption().matches(options::OPT_Wl_COMMA) &&
!A->getOption().matches(options::OPT_Xlinker))
continue;
diff --git a/clang/test/Driver/darwin-ld.c b/clang/test/Driver/darwin-ld.c
index 9275d0ff08f..9dd2e2b6ca0 100644
--- a/clang/test/Driver/darwin-ld.c
+++ b/clang/test/Driver/darwin-ld.c
@@ -356,6 +356,8 @@
// RUN: FileCheck -check-prefix=LINK_PROFILE_FIRST %s < %t.log
// LINK_PROFILE_FIRST: {{ld(.exe)?"}} "{{[^"]+}}libclang_rt.profile_{{[a-z]+}}.a"
+// RUN: %clang -target x86_64-apple-darwin12 -fprofile-instr-generate -exported_symbols_list /dev/null -### %t.o 2> %t.log
+// RUN: FileCheck -check-prefix=PROFILE_EXPORT %s < %t.log
// RUN: %clang -target x86_64-apple-darwin12 -fprofile-instr-generate -Wl,-exported_symbols_list,/dev/null -### %t.o 2> %t.log
// RUN: FileCheck -check-prefix=PROFILE_EXPORT %s < %t.log
// RUN: %clang -target x86_64-apple-darwin12 -fprofile-instr-generate -Wl,-exported_symbol,foo -### %t.o 2> %t.log
OpenPOWER on IntegriCloud