Updating iree_status_t usage and adding tons of error messages.
Progress on #265.
diff --git a/bindings/python/pyiree/rt/vm.cc b/bindings/python/pyiree/rt/vm.cc
index 0f79099..a46088a 100644
--- a/bindings/python/pyiree/rt/vm.cc
+++ b/bindings/python/pyiree/rt/vm.cc
@@ -117,7 +117,8 @@
attrs.push_back({});
auto status = iree_vm_get_function_reflection_attr(
f, i, &attrs.back().first, &attrs.back().second);
- if (status == IREE_STATUS_NOT_FOUND) {
+ if (iree_status_is_not_found(status) {
+ iree_status_ignore(status);
attrs.pop_back();
break;
}
@@ -165,7 +166,7 @@
{static_cast<const uint8_t*>(buffer_info.ptr),
static_cast<iree_host_size_t>(buffer_info.size)},
deallocator, IREE_ALLOCATOR_SYSTEM, &module);
- if (status != IREE_STATUS_OK) {
+ if (!iree_status_is_ok(status)) {
deallocator.free(raw_ptr, nullptr);
}
@@ -178,7 +179,8 @@
iree_vm_function_t f;
auto status = iree_vm_module_lookup_function_by_name(
raw_ptr(), linkage, {name.data(), name.size()}, &f);
- if (status == IREE_STATUS_NOT_FOUND) {
+ if (iree_status_is_not_found(status)) {
+ iree_status_ignore(status);
return absl::nullopt;
}
CheckApiStatus(status, "Error looking up function");
@@ -236,10 +238,10 @@
}
void SetupVmBindings(pybind11::module m) {
- CHECK_EQ(IREE_STATUS_OK, iree_vm_register_builtin_types());
- CHECK_EQ(IREE_STATUS_OK, iree_hal_module_register_types());
- CHECK_EQ(IREE_STATUS_OK, iree_tensorlist_module_register_types());
- CHECK_EQ(IREE_STATUS_OK, iree_strings_module_register_types());
+ IREE_CHECK_OK(iree_vm_register_builtin_types());
+ IREE_CHECK_OK(iree_hal_module_register_types());
+ IREE_CHECK_OK(iree_tensorlist_module_register_types());
+ IREE_CHECK_OK(iree_strings_module_register_types());
// Built-in module creation.
m.def("create_hal_module", &CreateHalModule);