[mlir] fix region property generation in python bindings

This commit is contained in:
Alex Zinenko 2021-10-20 18:56:20 +02:00
parent 6b6564fcf9
commit 310736e098
2 changed files with 4 additions and 4 deletions

View File

@ -405,11 +405,11 @@ def VariadicAndNormalRegionOp : TestOp<"variadic_and_normal_region"> {
let regions = (region AnyRegion:$region, AnyRegion, VariadicRegion<AnyRegion>:$variadic); let regions = (region AnyRegion:$region, AnyRegion, VariadicRegion<AnyRegion>:$variadic);
// CHECK: @builtins.property // CHECK: @builtins.property
// CHECK: def region(): // CHECK: def region(self):
// CHECK: return self.regions[0] // CHECK: return self.regions[0]
// CHECK: @builtins.property // CHECK: @builtins.property
// CHECK: def variadic(): // CHECK: def variadic(self):
// CHECK: return self.regions[2:] // CHECK: return self.regions[2:]
} }
@ -429,7 +429,7 @@ def VariadicRegionOp : TestOp<"variadic_region"> {
let regions = (region VariadicRegion<AnyRegion>:$Variadic); let regions = (region VariadicRegion<AnyRegion>:$Variadic);
// CHECK: @builtins.property // CHECK: @builtins.property
// CHECK: def Variadic(): // CHECK: def Variadic(self):
// CHECK: return self.regions[0:] // CHECK: return self.regions[0:]
} }

View File

@ -254,7 +254,7 @@ constexpr const char *attributeDeleterTemplate = R"Py(
constexpr const char *regionAccessorTemplate = R"PY( constexpr const char *regionAccessorTemplate = R"PY(
@builtins.property @builtins.property
def {0}(): def {0}(self):
return self.regions[{1}] return self.regions[{1}]
)PY"; )PY";