diff --git a/mlir/include/mlir/IR/DialectImplementation.h b/mlir/include/mlir/IR/DialectImplementation.h --- a/mlir/include/mlir/IR/DialectImplementation.h +++ b/mlir/include/mlir/IR/DialectImplementation.h @@ -228,6 +228,14 @@ /// Parse a `=` token if present. virtual ParseResult parseOptionalEqual() = 0; + /// Parse a quoted string token. + ParseResult parseString(StringRef *string) { + auto loc = getCurrentLocation(); + if (parseOptionalString(string)) + return emitError(loc, "expected string"); + return success(); + } + /// Parse a quoted string token if present. virtual ParseResult parseOptionalString(StringRef *string) = 0;