summaryrefslogtreecommitdiffstats
path: root/clang/lib/Driver/ToolChains.cpp
diff options
context:
space:
mode:
authorJustin Bogner <mail@justinbogner.com>2015-05-12 05:44:36 +0000
committerJustin Bogner <mail@justinbogner.com>2015-05-12 05:44:36 +0000
commitc7701240edd7c32b45c8193c40242e6ebf78fe9e (patch)
treefdd3e0ed249954451d84586cd52c1a5554b5bb90 /clang/lib/Driver/ToolChains.cpp
parenta0ff540b7e16fae62f8be0fedf65fe8ff20fbcf5 (diff)
downloadbcm5719-llvm-c7701240edd7c32b45c8193c40242e6ebf78fe9e.tar.gz
bcm5719-llvm-c7701240edd7c32b45c8193c40242e6ebf78fe9e.zip
Re-apply "Driver: Make profiling flags work with -nostdlib on Darwin"
This time without a stray "true" in an argument list. This reverts r237077, restoring r237074. llvm-svn: 237091
Diffstat (limited to 'clang/lib/Driver/ToolChains.cpp')
-rw-r--r--clang/lib/Driver/ToolChains.cpp34
1 files changed, 20 insertions, 14 deletions
diff --git a/clang/lib/Driver/ToolChains.cpp b/clang/lib/Driver/ToolChains.cpp
index 0d9e2120396..4ecd9a9c3f7 100644
--- a/clang/lib/Driver/ToolChains.cpp
+++ b/clang/lib/Driver/ToolChains.cpp
@@ -326,6 +326,26 @@ void MachO::AddLinkRuntimeLib(const ArgList &Args, ArgStringList &CmdArgs,
}
}
+void MachO::addProfileRTLibs(const ArgList &Args,
+ ArgStringList &CmdArgs) const {
+ if (!(Args.hasFlag(options::OPT_fprofile_arcs, options::OPT_fno_profile_arcs,
+ false) ||
+ Args.hasArg(options::OPT_fprofile_generate) ||
+ Args.hasArg(options::OPT_fprofile_instr_generate) ||
+ Args.hasArg(options::OPT_fprofile_instr_generate_EQ) ||
+ Args.hasArg(options::OPT_fcreate_profile) ||
+ Args.hasArg(options::OPT_coverage)))
+ return;
+
+ // Select the appropriate runtime library for the target.
+ if (isTargetIOSBased())
+ AddLinkRuntimeLib(Args, CmdArgs, "libclang_rt.profile_ios.a",
+ /*AlwaysLink*/ true);
+ else
+ AddLinkRuntimeLib(Args, CmdArgs, "libclang_rt.profile_osx.a",
+ /*AlwaysLink*/ true);
+}
+
void DarwinClang::AddLinkSanitizerLibArgs(const ArgList &Args,
ArgStringList &CmdArgs,
StringRef Sanitizer) const {
@@ -376,20 +396,6 @@ void DarwinClang::AddLinkRuntimeLibArgs(const ArgList &Args,
return;
}
- // If we are building profile support, link that library in.
- if (Args.hasFlag(options::OPT_fprofile_arcs, options::OPT_fno_profile_arcs,
- false) ||
- Args.hasArg(options::OPT_fprofile_generate) ||
- Args.hasArg(options::OPT_fprofile_instr_generate) ||
- Args.hasArg(options::OPT_fprofile_instr_generate_EQ) ||
- Args.hasArg(options::OPT_fcreate_profile) ||
- Args.hasArg(options::OPT_coverage)) {
- // Select the appropriate runtime library for the target.
- if (isTargetIOSBased())
- AddLinkRuntimeLib(Args, CmdArgs, "libclang_rt.profile_ios.a");
- else
- AddLinkRuntimeLib(Args, CmdArgs, "libclang_rt.profile_osx.a");
- }
const SanitizerArgs &Sanitize = getSanitizerArgs();
OpenPOWER on IntegriCloud