@@ -1763,6 +1763,23 @@ class PyConcreteAttribute : public BaseTy {
1763
1763
static void bindDerived (ClassTy &m) {}
1764
1764
};
1765
1765
1766
+ class PyAffineMapAttribute : public PyConcreteAttribute <PyAffineMapAttribute> {
1767
+ public:
1768
+ static constexpr IsAFunctionTy isaFunction = mlirAttributeIsAAffineMap;
1769
+ static constexpr const char *pyClassName = " AffineMapAttr" ;
1770
+ using PyConcreteAttribute::PyConcreteAttribute;
1771
+
1772
+ static void bindDerived (ClassTy &c) {
1773
+ c.def_static (
1774
+ " get" ,
1775
+ [](PyAffineMap &affineMap) {
1776
+ MlirAttribute attr = mlirAffineMapAttrGet (affineMap.get ());
1777
+ return PyAffineMapAttribute (affineMap.getContext (), attr);
1778
+ },
1779
+ py::arg (" affine_map" ), " Gets an attribute wrapping an AffineMap." );
1780
+ }
1781
+ };
1782
+
1766
1783
class PyArrayAttribute : public PyConcreteAttribute <PyArrayAttribute> {
1767
1784
public:
1768
1785
static constexpr IsAFunctionTy isaFunction = mlirAttributeIsAArray;
@@ -3994,17 +4011,18 @@ void mlir::python::populateIRSubmodule(py::module &m) {
3994
4011
" The underlying generic attribute of the NamedAttribute binding" );
3995
4012
3996
4013
// Builtin attribute bindings.
3997
- PyFloatAttribute ::bind (m);
4014
+ PyAffineMapAttribute ::bind (m);
3998
4015
PyArrayAttribute::bind (m);
3999
4016
PyArrayAttribute::PyArrayAttributeIterator::bind (m);
4000
- PyIntegerAttribute::bind (m);
4001
4017
PyBoolAttribute::bind (m);
4002
- PyFlatSymbolRefAttribute::bind (m);
4003
- PyStringAttribute::bind (m);
4004
4018
PyDenseElementsAttribute::bind (m);
4005
- PyDenseIntElementsAttribute::bind (m);
4006
4019
PyDenseFPElementsAttribute::bind (m);
4020
+ PyDenseIntElementsAttribute::bind (m);
4007
4021
PyDictAttribute::bind (m);
4022
+ PyFlatSymbolRefAttribute::bind (m);
4023
+ PyFloatAttribute::bind (m);
4024
+ PyIntegerAttribute::bind (m);
4025
+ PyStringAttribute::bind (m);
4008
4026
PyTypeAttribute::bind (m);
4009
4027
PyUnitAttribute::bind (m);
4010
4028
0 commit comments