From: Adam Nemet Date: Wed, 4 Oct 2017 04:25:31 +0000 (+0000) Subject: Move verbosity check for opt remarks to the diag handler. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=eb5cf2772e69d4a06981255554b7de2002974707;p=clang Move verbosity check for opt remarks to the diag handler. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@314873 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/CodeGen/CodeGenAction.cpp b/lib/CodeGen/CodeGenAction.cpp index 51dee17544..7f9c3771f1 100644 --- a/lib/CodeGen/CodeGenAction.cpp +++ b/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.