[MLIR] [Python] Fix the Windows build broken by d747a17
authorJohn Demme <john.demme@microsoft.com>
Wed, 10 Aug 2022 03:07:33 +0000 (20:07 -0700)
committerJohn Demme <john.demme@microsoft.com>
Wed, 10 Aug 2022 03:07:33 +0000 (20:07 -0700)
Windows builds require all control paths return. Since we don't have
`llvm_unreachable` in the Python bindings, just return `None`.

mlir/lib/Bindings/Python/IRCore.cpp

index db199b3..033edbd 100644 (file)
@@ -3117,7 +3117,7 @@ void mlir::python::populateIRCore(py::module &m) {
           kDumpDocstring)
       .def_property_readonly(
           "owner",
-          [](PyValue &self) {
+          [](PyValue &self) -> py::object {
             MlirValue v = self.get();
             if (mlirValueIsAOpResult(v)) {
               assert(
@@ -3134,6 +3134,7 @@ void mlir::python::populateIRCore(py::module &m) {
             }
 
             assert(false && "Value must be a block argument or an op result");
+            return py::none();
           })
       .def("__eq__",
            [](PyValue &self, PyValue &other) {