mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2024-12-12 18:02:43 +00:00
ca23c933bd
This patch adds attribute builders for all buildable attributes from the builtin dialect that did not previously have any. These builders can be used to construct attributes of a particular type identified by a string from a Python argument without knowing the details of how to pass that Python argument to the attribute constructor. This is used, for example, in the generated code of the Python bindings of ops. The list of "all" attributes was produced with: ( grep -h "ods_ir.AttrBuilder.get" $(find ../build/ -name "*_ops_gen.py") \ | cut -f2 -d"'" git grep -ho "^def [a-zA-Z0-9_]*" -- include/mlir/IR/CommonAttrConstraints.td \ | cut -f2 -d" " ) | sort -u Then, I only retained those that had an occurence in `mlir/include/mlir/IR`. In particular, this drops many dialect-specific attributes; registering those builders is something that those dialects should do. Finally, I removed those attrbiutes that had a match in `mlir/python/mlir/ir.py` already and implemented the remaining ones. The only ones that still miss a builder now are the following: * Represent more than one possible attribute type: - `Any.*Attr` (9x) - `IntNonNegative` - `IntPositive` - `IsNullAttr` - `ElementsAttr` * I am not sure what "constant attributes" are: - `ConstBoolAttrFalse` - `ConstBoolAttrTrue` - `ConstUnitAttr` * `Location` not exposed by Python bindings: - `LocationArrayAttr` - `LocationAttr` * `get` function not implemented in Python bindings: - `StringElementsAttr` This patch also fixes a compilation problem with `I64SmallVectorArrayAttr`. Reviewed By: makslevental, rkayaith Differential Revision: https://reviews.llvm.org/D159403 |
||
---|---|---|
.. | ||
benchmark/python | ||
cmake/modules | ||
docs | ||
examples | ||
include | ||
lib | ||
python | ||
test | ||
tools | ||
unittests | ||
utils | ||
.clang-format | ||
.clang-tidy | ||
CMakeLists.txt | ||
LICENSE.TXT | ||
README.md |
Multi-Level Intermediate Representation
See https://mlir.llvm.org/ for more information.