@@ -58,8 +58,7 @@ LogicalResult mlir::mlirTranslateMain(int argc, char **argv,
58
58
59
59
static llvm::cl::opt<bool > allowUnregisteredDialects (
60
60
" allow-unregistered-dialect" ,
61
- llvm::cl::desc (" Allow operation with no registered dialects "
62
- " (discouraged: testing only!)" ),
61
+ llvm::cl::desc (" Allow operation with no registered dialects (discouraged: testing only!)" ),
63
62
llvm::cl::init (false ));
64
63
65
64
static llvm::cl::opt<std::string> inputSplitMarker{
@@ -76,12 +75,14 @@ LogicalResult mlir::mlirTranslateMain(int argc, char **argv,
76
75
static llvm::cl::opt<SourceMgrDiagnosticVerifierHandler::Level>
77
76
verifyDiagnostics{
78
77
" verify-diagnostics" , llvm::cl::ValueOptional,
79
- llvm::cl::desc (" Check that emitted diagnostics match "
80
- " expected-* lines on the corresponding line" ),
78
+ llvm::cl::desc (" Check that emitted diagnostics match expected-* "
79
+ " lines on the corresponding line" ),
81
80
llvm::cl::values (
82
81
clEnumValN (
83
82
SourceMgrDiagnosticVerifierHandler::Level::All, " all" ,
84
83
" Check all diagnostics (expected, unexpected, near-misses)" ),
84
+ // Implicit value: when passed with no arguments, e.g.
85
+ // `--verify-diagnostics` or `--verify-diagnostics=`.
85
86
clEnumValN (
86
87
SourceMgrDiagnosticVerifierHandler::Level::All, " " ,
87
88
" Check all diagnostics (expected, unexpected, near-misses)" ),
@@ -160,7 +161,7 @@ LogicalResult mlir::mlirTranslateMain(int argc, char **argv,
160
161
161
162
MLIRContext context;
162
163
context.allowUnregisteredDialects (allowUnregisteredDialects);
163
- context.printOpOnDiagnostic (! bool ( verifyDiagnostics.getNumOccurrences ()) );
164
+ context.printOpOnDiagnostic (verifyDiagnostics.getNumOccurrences () == 0 );
164
165
auto sourceMgr = std::make_shared<llvm::SourceMgr>();
165
166
sourceMgr->AddNewSourceBuffer (std::move (ownedBuffer), SMLoc ());
166
167
0 commit comments