[Mlir-commits] [mlir] 60c735d - [mlir-opt] Don't enable `printOpOnDiagnostic` if it was explicitly disabled.

River Riddle llvmlistbot at llvm.org
Mon May 24 16:01:35 PDT 2021


Author: River Riddle
Date: 2021-05-24T15:56:48-07:00
New Revision: 60c735d409bf8077b2611d102b9a5e5af48464d5

URL: https://github.com/llvm/llvm-project/commit/60c735d409bf8077b2611d102b9a5e5af48464d5
DIFF: https://github.com/llvm/llvm-project/commit/60c735d409bf8077b2611d102b9a5e5af48464d5.diff

LOG: [mlir-opt] Don't enable `printOpOnDiagnostic` if it was explicitly disabled.

We are currently explicitly setting the flag solely based on the value of `-verify`, which ends up ignoring the situation where the user explicitly disabled this option from the command line.

Differential Revision: https://reviews.llvm.org/D102952

Added: 
    

Modified: 
    mlir/lib/Support/MlirOptMain.cpp

Removed: 
    


################################################################################
diff  --git a/mlir/lib/Support/MlirOptMain.cpp b/mlir/lib/Support/MlirOptMain.cpp
index 7c4930d6bdfa..7f4b6e1e99cb 100644
--- a/mlir/lib/Support/MlirOptMain.cpp
+++ b/mlir/lib/Support/MlirOptMain.cpp
@@ -109,7 +109,8 @@ static LogicalResult processBuffer(raw_ostream &os,
   if (preloadDialectsInContext)
     context.loadAllAvailableDialects();
   context.allowUnregisteredDialects(allowUnregisteredDialects);
-  context.printOpOnDiagnostic(!verifyDiagnostics);
+  if (verifyDiagnostics)
+    context.printOpOnDiagnostic(false);
   context.getDebugActionManager().registerActionHandler<DebugCounter>();
 
   // If we are in verify diagnostics mode then we have a lot of work to do,


        


More information about the Mlir-commits mailing list