r314873 - Move verbosity check for opt remarks to the diag handler.

Adam Nemet via cfe-commits cfe-commits at lists.llvm.org
Tue Oct 3 21:25:31 PDT 2017


Author: anemet
Date: Tue Oct  3 21:25:31 2017
New Revision: 314873

URL: http://llvm.org/viewvc/llvm-project?rev=314873&view=rev
Log:
Move verbosity check for opt remarks to the diag handler.

Modified:
    cfe/trunk/lib/CodeGen/CodeGenAction.cpp

Modified: cfe/trunk/lib/CodeGen/CodeGenAction.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CodeGenAction.cpp?rev=314873&r1=314872&r2=314873&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CodeGenAction.cpp (original)
+++ cfe/trunk/lib/CodeGen/CodeGenAction.cpp Tue Oct  3 21:25:31 2017
@@ -631,6 +631,10 @@ void BackendConsumer::EmitOptimizationMe
 
 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.




More information about the cfe-commits mailing list