summaryrefslogtreecommitdiffstats
path: root/clang/lib/Driver/ToolChains.cpp
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2011-11-17 00:36:57 +0000
committerDaniel Dunbar <daniel@zuster.org>2011-11-17 00:36:57 +0000
commit4f41440cf9fc3df3b7a8203a5f6c50d7cff17bc3 (patch)
tree480ebe504d75e93dc79e9d17524ded94e1f1d757 /clang/lib/Driver/ToolChains.cpp
parente285a7d3f0c09b4a8ace8680842a193c1b2b9f06 (diff)
downloadbcm5719-llvm-4f41440cf9fc3df3b7a8203a5f6c50d7cff17bc3.tar.gz
bcm5719-llvm-4f41440cf9fc3df3b7a8203a5f6c50d7cff17bc3.zip
clang/Darwin: Use the compiler-rt provided profile library.
llvm-svn: 144869
Diffstat (limited to 'clang/lib/Driver/ToolChains.cpp')
-rw-r--r--clang/lib/Driver/ToolChains.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/clang/lib/Driver/ToolChains.cpp b/clang/lib/Driver/ToolChains.cpp
index b232bc0584a..f4209ad08a2 100644
--- a/clang/lib/Driver/ToolChains.cpp
+++ b/clang/lib/Driver/ToolChains.cpp
@@ -454,6 +454,19 @@ void DarwinClang::AddLinkRuntimeLibArgs(const ArgList &Args,
return;
}
+ // If we are building profile support, link that library in.
+ if (Args.hasArg(options::OPT_fprofile_arcs) ||
+ Args.hasArg(options::OPT_fprofile_generate) ||
+ Args.hasArg(options::OPT_fcreate_profile) ||
+ Args.hasArg(options::OPT_coverage)) {
+ // Select the appropriate runtime library for the target.
+ if (isTargetIPhoneOS()) {
+ AddLinkRuntimeLib(Args, CmdArgs, "libclang_rt.profile_ios.a");
+ } else {
+ AddLinkRuntimeLib(Args, CmdArgs, "libclang_rt.profile_osx.a");
+ }
+ }
+
// Otherwise link libSystem, then the dynamic runtime library, and finally any
// target specific static runtime library.
CmdArgs.push_back("-lSystem");
OpenPOWER on IntegriCloud