diff options
author | Brian Gesiak <modocache@gmail.com> | 2017-07-01 05:45:26 +0000 |
---|---|---|
committer | Brian Gesiak <modocache@gmail.com> | 2017-07-01 05:45:26 +0000 |
commit | 562eab97eaa6f777c59818ba06d4597aa581efcb (patch) | |
tree | c59bd41331efc94265c3efbcf633d44589f04cd6 /clang/lib/Frontend/CompilerInvocation.cpp | |
parent | 5df526210aa2226893f40f70a1a60092a934be71 (diff) | |
download | bcm5719-llvm-562eab97eaa6f777c59818ba06d4597aa581efcb.tar.gz bcm5719-llvm-562eab97eaa6f777c59818ba06d4597aa581efcb.zip |
Un-revert "[Driver] Add -fdiagnostics-hotness-threshold"
Summary:
Un-revert https://reviews.llvm.org/D34868, but with a slight tweak to the
documentation to fix an error -- I had used the wrong syntax for a link.
llvm-svn: 306948
Diffstat (limited to 'clang/lib/Frontend/CompilerInvocation.cpp')
-rw-r--r-- | clang/lib/Frontend/CompilerInvocation.cpp | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/clang/lib/Frontend/CompilerInvocation.cpp b/clang/lib/Frontend/CompilerInvocation.cpp index b1b10ddf965..5851595dab7 100644 --- a/clang/lib/Frontend/CompilerInvocation.cpp +++ b/clang/lib/Frontend/CompilerInvocation.cpp @@ -909,12 +909,18 @@ static bool ParseCodeGenArgs(CodeGenOptions &Opts, ArgList &Args, InputKind IK, Opts.DiagnosticsWithHotness = Args.hasArg(options::OPT_fdiagnostics_show_hotness); bool UsingSampleProfile = !Opts.SampleProfileFile.empty(); - - if (Opts.DiagnosticsWithHotness && - Opts.getProfileUse() == CodeGenOptions::ProfileNone && - !UsingSampleProfile) { - Diags.Report(diag::warn_drv_fdiagnostics_show_hotness_requires_pgo); - } + bool UsingProfile = UsingSampleProfile || + (Opts.getProfileUse() != CodeGenOptions::ProfileNone); + + if (Opts.DiagnosticsWithHotness && !UsingProfile) + Diags.Report(diag::warn_drv_diagnostics_hotness_requires_pgo) + << "-fdiagnostics-show-hotness"; + + Opts.DiagnosticsHotnessThreshold = getLastArgUInt64Value( + Args, options::OPT_fdiagnostics_hotness_threshold_EQ, 0); + if (Opts.DiagnosticsHotnessThreshold > 0 && !UsingProfile) + Diags.Report(diag::warn_drv_diagnostics_hotness_requires_pgo) + << "-fdiagnostics-hotness-threshold="; // If the user requested to use a sample profile for PGO, then the // backend will need to track source location information so the profile |