MLIR 22.0.0git
MLIRGen.h
Go to the documentation of this file.
1//===- MLIRGen.h - MLIR PDLL Code Generation --------------------*- 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#ifndef MLIR_TOOLS_PDLL_CODEGEN_MLIRGEN_H_
10#define MLIR_TOOLS_PDLL_CODEGEN_MLIRGEN_H_
11
12#include <memory>
13
14namespace llvm {
15class SourceMgr;
16} // namespace llvm
17
18namespace mlir {
19class MLIRContext;
20class ModuleOp;
21template <typename OpT>
22class OwningOpRef;
23
24namespace pdll {
25namespace ast {
26class Context;
27class Module;
28} // namespace ast
29
30/// Given a PDLL module, generate an MLIR PDL pattern module within the given
31/// MLIR context.
32OwningOpRef<ModuleOp> codegenPDLLToMLIR(MLIRContext *mlirContext,
33 const ast::Context &context,
34 const llvm::SourceMgr &sourceMgr,
35 const ast::Module &module);
36} // namespace pdll
37} // namespace mlir
38
39#endif // MLIR_TOOLS_PDLL_CODEGEN_MLIRGEN_H_
MLIRContext is the top-level object for a collection of MLIR operations.
Definition MLIRContext.h:63
This class acts as an owning reference to an op, and will automatically destroy the held op on destru...
Definition OwningOpRef.h:29
This class represents the main context of the PDLL AST.
Definition Context.h:25
This class represents a top-level AST module.
Definition Nodes.h:1297
The OpAsmOpInterface, see OpAsmInterface.td for more details.
Definition CallGraph.h:229
OwningOpRef< ModuleOp > codegenPDLLToMLIR(MLIRContext *mlirContext, const ast::Context &context, const llvm::SourceMgr &sourceMgr, const ast::Module &module)
Given a PDLL module, generate an MLIR PDL pattern module within the given MLIR context.
Definition MLIRGen.cpp:624
Include the generated interface declarations.