diff options
author | Rong Xu <xur@google.com> | 2016-02-04 18:39:09 +0000 |
---|---|---|
committer | Rong Xu <xur@google.com> | 2016-02-04 18:39:09 +0000 |
commit | 9837ef56b45486930a50f4c0b31c37d4f71be957 (patch) | |
tree | 7cc0d30c0332dc59fc670d3c7ca2c038c723f718 /clang/lib/Driver/Tools.cpp | |
parent | 375882dddb92b4cf9fac72b3388b9c4af35d8ba6 (diff) | |
download | bcm5719-llvm-9837ef56b45486930a50f4c0b31c37d4f71be957.tar.gz bcm5719-llvm-9837ef56b45486930a50f4c0b31c37d4f71be957.zip |
[PGO] cc1 option name change for profile instrumentation
This patch changes cc1 option -fprofile-instr-generate to an enum option
-fprofile-instrument={clang|none}. It also changes cc1 options
-fprofile-instr-generate= to -fprofile-instrument-path=.
The driver level option -fprofile-instr-generate and -fprofile-instr-generate=
remain intact. This change will pave the way to integrate new PGO
instrumentation in IR level.
Review: http://reviews.llvm.org/D16730
llvm-svn: 259811
Diffstat (limited to 'clang/lib/Driver/Tools.cpp')
-rw-r--r-- | clang/lib/Driver/Tools.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/clang/lib/Driver/Tools.cpp b/clang/lib/Driver/Tools.cpp index 29bdbfc088b..b16c6722505 100644 --- a/clang/lib/Driver/Tools.cpp +++ b/clang/lib/Driver/Tools.cpp @@ -3224,15 +3224,17 @@ static void addPGOAndCoverageFlags(Compilation &C, const Driver &D, if (ProfileGenerateArg) { if (ProfileGenerateArg->getOption().matches( options::OPT_fprofile_instr_generate_EQ)) - ProfileGenerateArg->render(Args, CmdArgs); + CmdArgs.push_back(Args.MakeArgString(Twine("-fprofile-instrument-path=") + + ProfileGenerateArg->getValue())); else if (ProfileGenerateArg->getOption().matches( options::OPT_fprofile_generate_EQ)) { SmallString<128> Path(ProfileGenerateArg->getValue()); llvm::sys::path::append(Path, "default.profraw"); CmdArgs.push_back( - Args.MakeArgString(Twine("-fprofile-instr-generate=") + Path)); - } else - Args.AddAllArgs(CmdArgs, options::OPT_fprofile_instr_generate); + Args.MakeArgString(Twine("-fprofile-instrument-path=") + Path)); + } + // The default is to use Clang Instrumentation. + CmdArgs.push_back("-fprofile-instrument=clang"); } if (ProfileUseArg) { |