1//===-- TestDialect.td - Test dialect definition -----------*- tablegen -*-===//
2//
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
6//
7//===----------------------------------------------------------------------===//
8
9#ifndef TEST_DIALECT
10#define TEST_DIALECT
11
12include "mlir/IR/OpBase.td"
13
14def Test_Dialect : Dialect {
15  let name = "test";
16  let cppNamespace = "::test";
17  let emitAccessorPrefix = kEmitAccessorPrefix_Prefixed;
18  let hasCanonicalizer = 1;
19  let hasConstantMaterializer = 1;
20  let hasOperationAttrVerify = 1;
21  let hasRegionArgAttrVerify = 1;
22  let hasRegionResultAttrVerify = 1;
23  let hasOperationInterfaceFallback = 1;
24  let hasNonDefaultDestructor = 1;
25  let useDefaultTypePrinterParser = 0;
26  let dependentDialects = ["::mlir::DLTIDialect"];
27
28  let extraClassDeclaration = [{
29    void registerAttributes();
30    void registerTypes();
31
32    // Provides a custom printing/parsing for some operations.
33    ::llvm::Optional<ParseOpHook>
34      getParseOperationHook(::llvm::StringRef opName) const override;
35    ::llvm::unique_function<void(::mlir::Operation *,
36                                 ::mlir::OpAsmPrinter &printer)>
37     getOperationPrinter(::mlir::Operation *op) const override;
38
39     ::mlir::Type parseType(::mlir::DialectAsmParser &parser) const override;
40     void printType(::mlir::Type type,
41                    ::mlir::DialectAsmPrinter &printer) const override;
42  private:
43    // Storage for a custom fallback interface.
44    void *fallbackEffectOpInterfaces;
45
46  }];
47}
48
49#endif // TEST_DIALECT
50