#include "mlir/Tools/PDLL/CodeGen/CPPGen.h"
#include "mlir/Dialect/PDL/IR/PDL.h"
#include "mlir/Dialect/PDL/IR/PDLOps.h"
#include "mlir/IR/BuiltinOps.h"
#include "mlir/Tools/PDLL/AST/Nodes.h"
#include "mlir/Tools/PDLL/ODS/Operation.h"
#include "llvm/ADT/SmallString.h"
#include "llvm/ADT/StringExtras.h"
#include "llvm/ADT/StringSet.h"
#include "llvm/ADT/TypeSwitch.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/FormatVariadic.h"
#include <optional>
usingnamespacemlir;
usingnamespacemlir::pdll;
namespace {
class CodeGen { … };
}
void CodeGen::generate(const ast::Module &astModule, ModuleOp module) { … }
void CodeGen::generate(pdl::PatternOp pattern, StringRef patternName,
StringSet<> &nativeFunctions) { … }
void CodeGen::generateConstraintAndRewrites(const ast::Module &astModule,
ModuleOp module,
StringSet<> &nativeFunctions) { … }
void CodeGen::generate(const ast::UserConstraintDecl *decl,
StringSet<> &nativeFunctions) { … }
void CodeGen::generate(const ast::UserRewriteDecl *decl,
StringSet<> &nativeFunctions) { … }
StringRef CodeGen::getNativeTypeName(ast::Type type) { … }
StringRef CodeGen::getNativeTypeName(ast::VariableDecl *decl) { … }
void CodeGen::generateConstraintOrRewrite(const ast::CallableDecl *decl,
bool isConstraint,
StringSet<> &nativeFunctions) { … }
void mlir::pdll::codegenPDLLToCPP(const ast::Module &astModule, ModuleOp module,
raw_ostream &os) { … }