Skip to content

Commit 700a237

Browse files
committed
incorporate remaining comments
1 parent a7ac3cf commit 700a237

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

mlir/lib/Bindings/Python/IRCore.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1913,6 +1913,8 @@ pybind11::object PyValue::maybeDownCast() {
19131913
"mlirTypeID was expected to be non-null.");
19141914
std::optional<pybind11::function> valueCaster =
19151915
PyGlobals::get().lookupValueCaster(mlirTypeID, mlirTypeGetDialect(type));
1916+
// py::return_value_policy::move means use std::move to move the return value
1917+
// contents into a new instance that will be owned by Python.
19161918
py::object thisObj = py::cast(this, py::return_value_policy::move);
19171919
if (!valueCaster)
19181920
return thisObj;

mlir/test/python/ir/value.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -366,7 +366,7 @@ def dont_cast_int_shouldnt_register(v):
366366
...
367367

368368
except RuntimeError as e:
369-
# CHECK: Value caster is already registered: <function testValueCasters.<locals>.cast_int at
369+
# CHECK: Value caster is already registered: {{.*}}cast_int
370370
print(e)
371371

372372
@register_value_caster(IntegerType.static_typeid, replace=True)

0 commit comments

Comments
 (0)