Add hint for some vm context function resolution errors. (#2460)
If you just pass a VM bytecode module with no HAL module to `iree_vm_context_create_with_modules`, now the error message is:
```
Unable to resolve VM function 'hal.ex.shared_device'. Ensure modules are registered with the context.
```
diff --git a/iree/vm/context.c b/iree/vm/context.c
index 6998ea2..3af6f09 100644
--- a/iree/vm/context.c
+++ b/iree/vm/context.c
@@ -102,11 +102,11 @@
iree_vm_context_resolve_function(context, full_name, &import_function);
if (!iree_status_is_ok(status)) {
// iree_string_view_t is not NUL-terminated, so this is a bit awkward.
- fprintf(stderr, "unable to resolve VM function '");
+ fprintf(stderr, "Unable to resolve VM function '");
for (size_t i = 0; i < full_name.size; i++) {
fputc(full_name.data[i], stderr);
}
- fprintf(stderr, "'\n");
+ fprintf(stderr, "'. Ensure modules are registered with the context.\n");
return status;
}
IREE_RETURN_IF_ERROR(