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