summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CodeGenAction.cpp
diff options
context:
space:
mode:
authorAdam Nemet <anemet@apple.com>2017-10-04 04:25:31 +0000
committerAdam Nemet <anemet@apple.com>2017-10-04 04:25:31 +0000
commit28c2c22624dd03f56862b62fd1c2ccea8d22cdd8 (patch)
treed3f2ee60f87929df223a1dfef277fccf32072902 /clang/lib/CodeGen/CodeGenAction.cpp
parent289728d5a6ed09bc657f04ec4db6e1ee0c5121cf (diff)
downloadbcm5719-llvm-28c2c22624dd03f56862b62fd1c2ccea8d22cdd8.tar.gz
bcm5719-llvm-28c2c22624dd03f56862b62fd1c2ccea8d22cdd8.zip
Move verbosity check for opt remarks to the diag handler.
llvm-svn: 314873
Diffstat (limited to 'clang/lib/CodeGen/CodeGenAction.cpp')
-rw-r--r--clang/lib/CodeGen/CodeGenAction.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CodeGenAction.cpp b/clang/lib/CodeGen/CodeGenAction.cpp
index 51dee175447..7f9c3771f14 100644
--- a/clang/lib/CodeGen/CodeGenAction.cpp
+++ b/clang/lib/CodeGen/CodeGenAction.cpp
@@ -631,6 +631,10 @@ void BackendConsumer::EmitOptimizationMessage(
void BackendConsumer::OptimizationRemarkHandler(
const llvm::DiagnosticInfoOptimizationBase &D) {
+ // Without hotness information, don't show noisy remarks.
+ if (D.isVerbose() && !D.getHotness())
+ return;
+
if (D.isPassed()) {
// Optimization remarks are active only if the -Rpass flag has a regular
// expression that matches the name of the pass name in \p D.
OpenPOWER on IntegriCloud