12 #include "mlir/IR/DialectImplementation.h"
13 #include "llvm/ADT/StringExtras.h"
14 #include "llvm/ADT/StringSwitch.h"
15 #include "llvm/ADT/TypeSwitch.h"
17 using namespace circt;
18 using namespace kanagawa;
21 auto scopeRef = dyn_cast<ScopeRefType>(type);
25 return scopeRef.isOpaque();
28 Type ScopeRefType::parse(AsmParser &p) {
29 if (p.parseOptionalLess())
33 if (p.parseAttribute(attr) || p.parseGreater())
35 if (attr.getNestedReferences().size() != 1) {
36 p.emitError(p.getNameLoc(),
"expected @outer::@inner format");
40 p.getBuilder().getContext(),
44 void ScopeRefType::print(AsmPrinter &p)
const {
45 if (
auto ref = getScopeRef())
49 #define GET_TYPEDEF_CLASSES
50 #include "circt/Dialect/Kanagawa/KanagawaTypes.cpp.inc"
52 void KanagawaDialect::registerTypes() {
55 #define GET_TYPEDEF_LIST
56 #include "circt/Dialect/Kanagawa/KanagawaTypes.cpp.inc"
Direction get(bool isOutput)
Returns an output direction if isOutput is true, otherwise returns an input direction.
bool isOpaqueScopeRefType(mlir::Type type)
The InstanceGraph op interface, see InstanceGraphInterface.td for more details.