MLIR  21.0.0git
IRDLToCpp.h
Go to the documentation of this file.
1 //===- IRDLToCpp.h - Register translation -----------------------*- C++ -*-===//
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 // This file defines the registration function for the IRDL to C++ translation.
10 //
11 //===----------------------------------------------------------------------===//
12 
13 #ifndef MLIR_TARGET_IRDLTOCPP_IRDLTOCPP_H
14 #define MLIR_TARGET_IRDLTOCPP_IRDLTOCPP_H
15 
17 
18 namespace mlir {
19 namespace irdl {
20 
21 /// Translates an IRDL dialect definition to a C++ definition that can be used
22 /// with MLIR.
23 ///
24 /// The following preprocessor macros will generate the following code:
25 ///
26 /// // This define generates code for the dialect's class declarations
27 /// #define GEN_DIALECT_DECL_HEADER
28 ///
29 /// // This define generates code for the dialect's class definitions
30 /// #define GEN_DIALECT_DEF
31 LogicalResult
33  raw_ostream &output);
34 
35 } // namespace irdl
36 } // namespace mlir
37 
38 #endif // MLIR_TARGET_IRDLTOCPP_IRDLTOCPP_H
LogicalResult translateIRDLDialectToCpp(llvm::ArrayRef< irdl::DialectOp > dialects, raw_ostream &output)
Translates an IRDL dialect definition to a C++ definition that can be used with MLIR.
Definition: IRDLToCpp.cpp:491
Include the generated interface declarations.