[RTL] remove redundant error in type parser.

This also fixes a clang tidy issue I introduced in a previous patch.
This commit is contained in:
Chris Lattner 2020-11-22 15:41:25 -08:00
parent b8bdfed633
commit 5305cfbaaa
3 changed files with 4 additions and 11 deletions

View File

@ -19,7 +19,7 @@ class DialectAsmPrinter;
namespace circt {
namespace rtl {
using Location = ::mlir::Location;
}
} // namespace rtl
} // namespace circt
#define GET_TYPEDEF_CLASSES

View File

@ -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

View File

@ -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<tensor<*xf32>>) { }