@@ -3726,30 +3726,22 @@ void mlir::python::populateIRCore(py::module &m) {
37263726 kValueReplaceAllUsesWithDocstring )
37273727 .def (
37283728 " replace_all_uses_except" ,
3729- [](PyValue &self, PyValue &with, PyOperation &exception) {
3730- MlirValue selfValue = self.get ();
3731- MlirValue withValue = with.get ();
3732- MlirOperation exceptedUser = exception.get ();
3733-
3734- mlirValueReplaceAllUsesExceptWithSingle (selfValue, withValue,
3735- exceptedUser);
3729+ [](MlirValue self, MlirValue with, MlirOperation exception) {
3730+ mlirValueReplaceAllUsesExceptWithSingle (self, with, exception);
37363731 },
37373732 py::arg (" with" ), py::arg (" exceptions" ),
37383733 kValueReplaceAllUsesExceptDocstring )
37393734 .def (
37403735 " replace_all_uses_except" ,
3741- [](PyValue &self, PyValue &with, py::list exceptions) {
3742- MlirValue selfValue = self.get ();
3743- MlirValue withValue = with.get ();
3744-
3736+ [](MlirValue self, MlirValue with, py::list exceptions) {
37453737 // Convert Python list to a SmallVector of MlirOperations
37463738 llvm::SmallVector<MlirOperation, 4 > exceptionOps;
37473739 for (py::handle exception : exceptions) {
37483740 exceptionOps.push_back (exception.cast <PyOperation &>().get ());
37493741 }
37503742
37513743 mlirValueReplaceAllUsesExceptWithSet (
3752- selfValue, withValue , exceptionOps.data (),
3744+ self, with , exceptionOps.data (),
37533745 static_cast <intptr_t >(exceptionOps.size ()));
37543746 },
37553747 py::arg (" with" ), py::arg (" exceptions" ),
0 commit comments