[mlir:PDLL] Rework the C++ generation of native Constraint/Rewrite arguments and...
authorRiver Riddle <riddleriver@gmail.com>
Tue, 3 May 2022 02:24:53 +0000 (19:24 -0700)
committerRiver Riddle <riddleriver@gmail.com>
Tue, 31 May 2022 00:35:34 +0000 (17:35 -0700)
commit1c2edb026ed67ddbb30ebe3e2d2f4f17a882a881
treee8cc0ba795052bff7ab44bcf1aacd555ce30152f
parent0429472efe6a894a6554d75fd77baeb9cdb32dd5
[mlir:PDLL] Rework the C++ generation of native Constraint/Rewrite arguments and results

The current translation uses the old "ugly"/"raw" form which used PDLValue for the arguments
and results. This commit updates the C++ generation to use the recently added sugar that
allows for directly using the desired types for the arguments and result of PDL functions.
In addition, this commit also properly imports the C++ class for ODS operations, constraints,
and interfaces. This allows for a much more convienent C++ API than previously granted
with the raw/low-level types.

Differential Revision: https://reviews.llvm.org/D124817
18 files changed:
mlir/docs/PDLL.md
mlir/include/mlir/IR/PatternMatch.h
mlir/include/mlir/Tools/PDLL/AST/Nodes.h
mlir/include/mlir/Tools/PDLL/AST/Types.h
mlir/include/mlir/Tools/PDLL/ODS/Context.h
mlir/include/mlir/Tools/PDLL/ODS/Dialect.h
mlir/include/mlir/Tools/PDLL/ODS/Operation.h
mlir/lib/Tools/PDLL/AST/Nodes.cpp
mlir/lib/Tools/PDLL/AST/TypeDetail.h
mlir/lib/Tools/PDLL/AST/Types.cpp
mlir/lib/Tools/PDLL/CodeGen/CPPGen.cpp
mlir/lib/Tools/PDLL/CodeGen/MLIRGen.cpp
mlir/lib/Tools/PDLL/ODS/Context.cpp
mlir/lib/Tools/PDLL/ODS/Dialect.cpp
mlir/lib/Tools/PDLL/ODS/Operation.cpp
mlir/lib/Tools/PDLL/Parser/Parser.cpp
mlir/lib/Tools/mlir-pdll-lsp-server/PDLLServer.cpp
mlir/test/mlir-pdll/CodeGen/CPP/general.pdll