Skip to content

Commit 6d74a2c

Browse files
committed
address comments
1 parent 5d15b5a commit 6d74a2c

File tree

3 files changed

+12
-9
lines changed

3 files changed

+12
-9
lines changed

mlir/examples/transform-opt/mlir-transform-opt.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,14 @@ struct MlirTransformOptCLOptions {
4040

4141
cl::opt<mlir::SourceMgrDiagnosticVerifierHandler::Level> verifyDiagnostics{
4242
"verify-diagnostics", llvm::cl::ValueOptional,
43-
cl::desc("Check that emitted diagnostics match "
44-
"expected-* lines on the corresponding line"),
43+
cl::desc("Check that emitted diagnostics match expected-* lines on the "
44+
"corresponding line"),
4545
cl::values(
4646
clEnumValN(
4747
mlir::SourceMgrDiagnosticVerifierHandler::Level::All, "all",
4848
"Check all diagnostics (expected, unexpected, near-misses)"),
49+
// Implicit value: when passed with no arguments, e.g.
50+
// `--verify-diagnostics` or `--verify-diagnostics=`.
4951
clEnumValN(
5052
mlir::SourceMgrDiagnosticVerifierHandler::Level::All, "",
5153
"Check all diagnostics (expected, unexpected, near-misses)"),

mlir/lib/Tools/mlir-opt/MlirOptMain.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -172,8 +172,8 @@ struct MlirOptMainConfigCLOptions : public MlirOptMainConfig {
172172
/*ExternalStorage=*/true>
173173
verifyDiagnostics{
174174
"verify-diagnostics", llvm::cl::ValueOptional,
175-
cl::desc("Check that emitted diagnostics match "
176-
"expected-* lines on the corresponding line"),
175+
cl::desc("Check that emitted diagnostics match expected-* lines on "
176+
"the corresponding line"),
177177
cl::location(verifyDiagnosticsFlag),
178178
cl::values(
179179
clEnumValN(SourceMgrDiagnosticVerifierHandler::Level::All,

mlir/lib/Tools/mlir-translate/MlirTranslateMain.cpp

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,7 @@ LogicalResult mlir::mlirTranslateMain(int argc, char **argv,
5858

5959
static llvm::cl::opt<bool> allowUnregisteredDialects(
6060
"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!)"),
6362
llvm::cl::init(false));
6463

6564
static llvm::cl::opt<std::string> inputSplitMarker{
@@ -76,12 +75,14 @@ LogicalResult mlir::mlirTranslateMain(int argc, char **argv,
7675
static llvm::cl::opt<SourceMgrDiagnosticVerifierHandler::Level>
7776
verifyDiagnostics{
7877
"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"),
8180
llvm::cl::values(
8281
clEnumValN(
8382
SourceMgrDiagnosticVerifierHandler::Level::All, "all",
8483
"Check all diagnostics (expected, unexpected, near-misses)"),
84+
// Implicit value: when passed with no arguments, e.g.
85+
// `--verify-diagnostics` or `--verify-diagnostics=`.
8586
clEnumValN(
8687
SourceMgrDiagnosticVerifierHandler::Level::All, "",
8788
"Check all diagnostics (expected, unexpected, near-misses)"),
@@ -160,7 +161,7 @@ LogicalResult mlir::mlirTranslateMain(int argc, char **argv,
160161

161162
MLIRContext context;
162163
context.allowUnregisteredDialects(allowUnregisteredDialects);
163-
context.printOpOnDiagnostic(!bool(verifyDiagnostics.getNumOccurrences()));
164+
context.printOpOnDiagnostic(verifyDiagnostics.getNumOccurrences() == 0);
164165
auto sourceMgr = std::make_shared<llvm::SourceMgr>();
165166
sourceMgr->AddNewSourceBuffer(std::move(ownedBuffer), SMLoc());
166167

0 commit comments

Comments
 (0)