1 //===-- TestDialect.td - Test dialect definition -----------*- tablegen -*-===//
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
12 include "mlir/IR/OpBase.td"
14 def Test_Dialect : Dialect {
16 let cppNamespace = "::test";
17 let hasCanonicalizer = 1;
18 let hasConstantMaterializer = 1;
19 let hasOperationAttrVerify = 1;
20 let hasRegionArgAttrVerify = 1;
21 let hasRegionResultAttrVerify = 1;
22 let hasOperationInterfaceFallback = 1;
23 let hasNonDefaultDestructor = 1;
24 let useDefaultTypePrinterParser = 0;
25 let useDefaultAttributePrinterParser = 1;
27 let dependentDialects = ["::mlir::DLTIDialect"];
28 let discardableAttrs = (ins
29 "mlir::IntegerAttr":$discardable_attr_key,
30 "SimpleAAttr":$other_discardable_attr_key
33 let extraClassDeclaration = [{
34 void registerAttributes();
35 void registerInterfaces();
37 void registerOpsSyntax();
39 // Provides a custom printing/parsing for some operations.
40 ::std::optional<ParseOpHook>
41 getParseOperationHook(::llvm::StringRef opName) const override;
42 ::llvm::unique_function<void(::mlir::Operation *,
43 ::mlir::OpAsmPrinter &printer)>
44 getOperationPrinter(::mlir::Operation *op) const override;
46 ::mlir::Type parseType(::mlir::DialectAsmParser &parser) const override;
47 void printType(::mlir::Type type,
48 ::mlir::DialectAsmPrinter &printer) const override;
51 // Storage for a custom fallback interface.
52 void *fallbackEffectOpInterfaces;
56 #endif // TEST_DIALECT