]> granicus.if.org Git - clang/commitdiff
Move verbosity check for opt remarks to the diag handler.
authorAdam Nemet <anemet@apple.com>
Wed, 4 Oct 2017 04:25:31 +0000 (04:25 +0000)
committerAdam Nemet <anemet@apple.com>
Wed, 4 Oct 2017 04:25:31 +0000 (04:25 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@314873 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/CodeGenAction.cpp

index 51dee175447e33ffa598e6131678549f18c0747f..7f9c3771f14babe6d2d034749a36008aa0bec994 100644 (file)
@@ -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.