summaryrefslogtreecommitdiffstats
path: root/clang/lib/Frontend/CompilerInvocation.cpp
diff options
context:
space:
mode:
authorRong Xu <xur@google.com>2016-02-29 18:54:59 +0000
committerRong Xu <xur@google.com>2016-02-29 18:54:59 +0000
commit522b5cb3753f39ceb021ab2511c54d7163940b06 (patch)
treefb80b468c405b0bef10c6f659a7a1cc1ed567dec /clang/lib/Frontend/CompilerInvocation.cpp
parent73cd686ce144730f876870658d1ed75d3ffcc7ae (diff)
downloadbcm5719-llvm-522b5cb3753f39ceb021ab2511c54d7163940b06.tar.gz
bcm5719-llvm-522b5cb3753f39ceb021ab2511c54d7163940b06.zip
[PGO] clang cc1 option change to enable IR level instrumentation
This patch expands cc1 option -fprofile-instrument= with a new value: -fprofile-instrument=llvm which enables IR level PGO instrumentation. Reviewers: davidxl, silvas Differential Revision: http://reviews.llvm.org/D17622 llvm-svn: 262239
Diffstat (limited to 'clang/lib/Frontend/CompilerInvocation.cpp')
-rw-r--r--clang/lib/Frontend/CompilerInvocation.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/clang/lib/Frontend/CompilerInvocation.cpp b/clang/lib/Frontend/CompilerInvocation.cpp
index 953d2a8479d..b23eb354375 100644
--- a/clang/lib/Frontend/CompilerInvocation.cpp
+++ b/clang/lib/Frontend/CompilerInvocation.cpp
@@ -481,18 +481,23 @@ static bool ParseCodeGenArgs(CodeGenOptions &Opts, ArgList &Args, InputKind IK,
Opts.Autolink = !Args.hasArg(OPT_fno_autolink);
Opts.SampleProfileFile = Args.getLastArgValue(OPT_fprofile_sample_use_EQ);
- enum PGOInstrumentor { Unknown, None, Clang };
+ enum PGOInstrumentor { Unknown, None, Clang, LLVM };
if (Arg *A = Args.getLastArg(OPT_fprofile_instrument_EQ)) {
StringRef Value = A->getValue();
PGOInstrumentor Method = llvm::StringSwitch<PGOInstrumentor>(Value)
- .Case("clang", Clang)
.Case("none", None)
+ .Case("clang", Clang)
+ .Case("llvm", LLVM)
.Default(Unknown);
switch (Method) {
+ case LLVM:
+ Opts.setProfileInstr(CodeGenOptions::ProfileIRInstr);
+ break;
case Clang:
Opts.setProfileInstr(CodeGenOptions::ProfileClangInstr);
break;
case None:
+ // Null operation -- The default is ProfileNone.
break;
case Unknown:
Diags.Report(diag::err_drv_invalid_pgo_instrumentor)
OpenPOWER on IntegriCloud