From 5305cfbaaaf7fd3efcdfcf64273a8fbf1e9808a4 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Sun, 22 Nov 2020 15:41:25 -0800 Subject: [PATCH] [RTL] remove redundant error in type parser. This also fixes a clang tidy issue I introduced in a previous patch. --- include/circt/Dialect/RTL/Types.h | 2 +- lib/Dialect/RTL/Dialect.cpp | 7 +------ test/rtl/errors.mlir | 6 ++---- 3 files changed, 4 insertions(+), 11 deletions(-) diff --git a/include/circt/Dialect/RTL/Types.h b/include/circt/Dialect/RTL/Types.h index 42b6a6214d..fa385b07a4 100644 --- a/include/circt/Dialect/RTL/Types.h +++ b/include/circt/Dialect/RTL/Types.h @@ -19,7 +19,7 @@ class DialectAsmPrinter; namespace circt { namespace rtl { using Location = ::mlir::Location; -} +} // namespace rtl } // namespace circt #define GET_TYPEDEF_CLASSES diff --git a/lib/Dialect/RTL/Dialect.cpp b/lib/Dialect/RTL/Dialect.cpp index 17c6c197e1..bed74fde93 100644 --- a/lib/Dialect/RTL/Dialect.cpp +++ b/lib/Dialect/RTL/Dialect.cpp @@ -83,12 +83,7 @@ Type RTLDialect::parseType(DialectAsmParser &parser) const { llvm::StringRef mnemonic; if (parser.parseKeyword(&mnemonic)) return Type(); - auto genType = generatedTypeParser(getContext(), parser, mnemonic); - if (genType) - return genType; - parser.emitError(parser.getCurrentLocation(), "Could not parse rtl.") - << mnemonic << "."; - return Type(); + return generatedTypeParser(getContext(), parser, mnemonic); } /// Print a type registered to this dialect. Try the tblgen'd type printer diff --git a/test/rtl/errors.mlir b/test/rtl/errors.mlir index 7a75063bc6..68fc7500af 100644 --- a/test/rtl/errors.mlir +++ b/test/rtl/errors.mlir @@ -67,12 +67,10 @@ rtl.module @B() { // ----- -// expected-error @+2 {{rtl.array only supports one dimension}} -// expected-error @+1 {{Could not parse rtl.array}} +// expected-error @+1 {{rtl.array only supports one dimension}} func @arrayDims(%a: !rtl.array<3 x 4 x i5>) { } // ----- -// expected-error @+2 {{invalid element for rtl.inout type}} -// expected-error @+1 {{Could not parse rtl.inout}} +// expected-error @+1 {{invalid element for rtl.inout type}} func @invalidInout(%arg0: !rtl.inout>) { } \ No newline at end of file