diff options
author | Matthias Springer <me@m-sp.org> | 2024-08-21 08:44:54 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-08-21 08:44:54 +0200 |
commit | a3d41879ecf5690a73f9226951d3856c7faa34a4 (patch) | |
tree | eabbe738155805bde5f008cd155489ecbdec4679 /clang/lib/Frontend/PrintPreprocessedOutput.cpp | |
parent | 90556efaa2f5703920cce4a9c0ee36365e15e2ab (diff) | |
download | llvm-a3d41879ecf5690a73f9226951d3856c7faa34a4.zip llvm-a3d41879ecf5690a73f9226951d3856c7faa34a4.tar.gz llvm-a3d41879ecf5690a73f9226951d3856c7faa34a4.tar.bz2 |
[mlir][ODS] Optionally generate public C++ functions for type constraints (#104577)
Add `gen-type-constraint-decls` and `gen-type-constraint-defs`, which
generate public C++ functions for type constraints. The name of the C++
function is specified in the `cppFunctionName` field.
Type constraints are typically used for op/type/attribute verification.
They are also sometimes called from builders and transformations. Until
now, this required duplicating the check in C++.
Note: This commit just adds the option for type constraints, but
attribute constraints could be supported in the same way.
Alternatives considered:
1. The C++ functions could also be generated as part of
`gen-typedef-decls/defs`, but that can be confusing because type
constraints may rely on type definitions from multiple `.td` files.
`#include`s could cause duplicate definitions of the same type
constraint.
2. The C++ functions could also be generated as static member functions
of dialects, but they don't really belong to a dialect. (Because they
may rely on type definitions from multiple dialects.)
Diffstat (limited to 'clang/lib/Frontend/PrintPreprocessedOutput.cpp')
0 files changed, 0 insertions, 0 deletions