summaryrefslogtreecommitdiffstats
path: root/clang/lib/Driver/ToolChains.cpp
diff options
context:
space:
mode:
authorDiego Novillo <dnovillo@google.com>2015-07-09 17:23:53 +0000
committerDiego Novillo <dnovillo@google.com>2015-07-09 17:23:53 +0000
commit578caf5da7f648e7e60f316779b6f2f7e1cb8e03 (patch)
tree64fe10d0ff1b71afcfc31940442093e2047b3261 /clang/lib/Driver/ToolChains.cpp
parenteae951415e1a3051666cc812838e3be2394340a0 (diff)
downloadbcm5719-llvm-578caf5da7f648e7e60f316779b6f2f7e1cb8e03.tar.gz
bcm5719-llvm-578caf5da7f648e7e60f316779b6f2f7e1cb8e03.zip
Add GCC-compatible flags -fprofile-generate and -fprofile-use.
This patch adds support for specifying where the profile is emitted in a way similar to GCC. These flags are used to specify directories instead of filenames. When -fprofile-generate=DIR is used, the compiler will generate code to write to <DIR>/default.profraw. The patch also adds a couple of extensions: LLVM_PROFILE_FILE can still be used to override the directory and file name to use and -fprofile-use accepts both directories and filenames. To simplify the set of flags used in the backend, all the flags get canonicalized to -fprofile-instr-{generate,use} when passed to the backend. The decision to use a default name for the profile is done in the driver. llvm-svn: 241825
Diffstat (limited to 'clang/lib/Driver/ToolChains.cpp')
-rw-r--r--clang/lib/Driver/ToolChains.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/clang/lib/Driver/ToolChains.cpp b/clang/lib/Driver/ToolChains.cpp
index 8a15a749be7..eafc72b6b12 100644
--- a/clang/lib/Driver/ToolChains.cpp
+++ b/clang/lib/Driver/ToolChains.cpp
@@ -303,6 +303,7 @@ void Darwin::addProfileRTLibs(const ArgList &Args,
if (!(Args.hasFlag(options::OPT_fprofile_arcs, options::OPT_fno_profile_arcs,
false) ||
Args.hasArg(options::OPT_fprofile_generate) ||
+ Args.hasArg(options::OPT_fprofile_generate_EQ) ||
Args.hasArg(options::OPT_fprofile_instr_generate) ||
Args.hasArg(options::OPT_fprofile_instr_generate_EQ) ||
Args.hasArg(options::OPT_fcreate_profile) ||
OpenPOWER on IntegriCloud