[RTL] Some minor tidying up after PR171

This commit is contained in:
Chris Lattner 2020-11-22 10:57:40 -08:00
parent 460f4b7dfd
commit 8612153972
4 changed files with 8 additions and 15 deletions

View File

@ -8,10 +8,12 @@
#ifndef CIRCT_DIALECT_RTL_TYPES_H #ifndef CIRCT_DIALECT_RTL_TYPES_H
#define CIRCT_DIALECT_RTL_TYPES_H #define CIRCT_DIALECT_RTL_TYPES_H
#include "mlir/IR/Dialect.h" #include "mlir/IR/Types.h"
#include "mlir/IR/Operation.h"
#include "Dialect.h" namespace mlir {
class DialectAsmParser;
class DialectAsmPrinter;
} // namespace mlir
#define GET_TYPEDEF_CLASSES #define GET_TYPEDEF_CLASSES
#include "circt/Dialect/RTL/RTLTypes.h.inc" #include "circt/Dialect/RTL/RTLTypes.h.inc"

View File

@ -18,10 +18,5 @@ def ArrayType : RTLType<"Array"> {
}]; }];
let mnemonic = "array"; let mnemonic = "array";
let parameters = (ins "::mlir::Type":$innerType, "size_t":$size);
let parameters = (
ins
"::mlir::Type":$innerType,
"size_t":$size
);
} }

View File

@ -8,7 +8,6 @@
#include "mlir/IR/Builders.h" #include "mlir/IR/Builders.h"
#include "mlir/IR/DialectImplementation.h" #include "mlir/IR/DialectImplementation.h"
#include "mlir/IR/StandardTypes.h" #include "mlir/IR/StandardTypes.h"
#include "llvm/Support/FormatVariadic.h"
using namespace circt; using namespace circt;
using namespace rtl; using namespace rtl;

View File

@ -1,4 +1,4 @@
//===- Types.cpp - RTL types code defs --------------------------*- C++ -*-===// //===- Types.cpp - RTL types code defs ------------------------------------===//
// //
// Definitions for RTL data types. Anything which doesn't have to be public // Definitions for RTL data types. Anything which doesn't have to be public
// should go in here. // should go in here.
@ -6,10 +6,7 @@
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
#include "circt/Dialect/RTL/Types.h" #include "circt/Dialect/RTL/Types.h"
#include "mlir/IR/Attributes.h"
#include "mlir/IR/DialectImplementation.h" #include "mlir/IR/DialectImplementation.h"
#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/Hashing.h"
#include "llvm/ADT/TypeSwitch.h" #include "llvm/ADT/TypeSwitch.h"
using namespace mlir; using namespace mlir;
@ -22,7 +19,7 @@ Type ArrayType::parse(MLIRContext *ctxt, DialectAsmParser &p) {
p.parseType(inner) || p.parseGreater()) p.parseType(inner) || p.parseGreater())
return Type(); return Type();
if (dims.size() != 1) { if (dims.size() != 1) {
p.emitError(p.getNameLoc(), "rtl.array only supports one dimension."); p.emitError(p.getNameLoc(), "rtl.array only supports one dimension");
return Type(); return Type();
} }
return get(ctxt, inner, dims[0]); return get(ctxt, inner, dims[0]);