xref: /llvm-project/mlir/examples/standalone/include/Standalone/StandaloneDialect.td (revision 83e9ef7e519a2eac56609268a10e88b251d87e15)
1160f5aa6SJean-Michel Gorius//===- StandaloneDialect.td - Standalone dialect -----------*- tablegen -*-===//
2160f5aa6SJean-Michel Gorius//
3160f5aa6SJean-Michel Gorius// This file is licensed under the Apache License v2.0 with LLVM Exceptions.
4160f5aa6SJean-Michel Gorius// See https://llvm.org/LICENSE.txt for license information.
5160f5aa6SJean-Michel Gorius// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6160f5aa6SJean-Michel Gorius//
7160f5aa6SJean-Michel Gorius//===----------------------------------------------------------------------===//
8160f5aa6SJean-Michel Gorius
9160f5aa6SJean-Michel Gorius#ifndef STANDALONE_DIALECT
10160f5aa6SJean-Michel Gorius#define STANDALONE_DIALECT
11160f5aa6SJean-Michel Gorius
12160f5aa6SJean-Michel Goriusinclude "mlir/IR/OpBase.td"
13160f5aa6SJean-Michel Gorius
14160f5aa6SJean-Michel Gorius//===----------------------------------------------------------------------===//
15160f5aa6SJean-Michel Gorius// Standalone dialect definition.
16160f5aa6SJean-Michel Gorius//===----------------------------------------------------------------------===//
17160f5aa6SJean-Michel Gorius
18160f5aa6SJean-Michel Goriusdef Standalone_Dialect : Dialect {
19160f5aa6SJean-Michel Gorius    let name = "standalone";
20160f5aa6SJean-Michel Gorius    let summary = "A standalone out-of-tree MLIR dialect.";
21160f5aa6SJean-Michel Gorius    let description = [{
22160f5aa6SJean-Michel Gorius        This dialect is an example of an out-of-tree MLIR dialect designed to
23160f5aa6SJean-Michel Gorius        illustrate the basic setup required to develop MLIR-based tools without
24160f5aa6SJean-Michel Gorius        working inside of the LLVM source tree.
25160f5aa6SJean-Michel Gorius    }];
261dac073bSMehdi Amini    let cppNamespace = "::mlir::standalone";
2775488a28SMarius Brehler
28*83e9ef7eSMarius Brehler    let useDefaultTypePrinterParser = 1;
29*83e9ef7eSMarius Brehler    let extraClassDeclaration = [{
30*83e9ef7eSMarius Brehler        void registerTypes();
31*83e9ef7eSMarius Brehler    }];
32160f5aa6SJean-Michel Gorius}
33160f5aa6SJean-Michel Gorius
34160f5aa6SJean-Michel Gorius//===----------------------------------------------------------------------===//
35160f5aa6SJean-Michel Gorius// Base standalone operation definition.
36160f5aa6SJean-Michel Gorius//===----------------------------------------------------------------------===//
37160f5aa6SJean-Michel Gorius
38697a5036SSanjoy Dasclass Standalone_Op<string mnemonic, list<Trait> traits = []> :
39160f5aa6SJean-Michel Gorius        Op<Standalone_Dialect, mnemonic, traits>;
40160f5aa6SJean-Michel Gorius
41160f5aa6SJean-Michel Gorius#endif // STANDALONE_DIALECT
42