Before this change we but everything into namespace 0 (so is_function() always returned true).
cranelift-simplejit/src/backend.rs::get_definition:
calls namespace.is_function(name) to figure out if it has to lookup a function or data definition.
But cranelift-module is_function() does this by comparing the namespace with 0:
// Return whether `name` names a function, rather than a data object.
pub fn is_function(&self, name: &ir::ExternalName) -> bool {
if let ir::ExternalName::User { namespace, .. } = *name {
namespace == 0
} else {
panic!("unexpected ExternalName kind {}", name)
}
}
Before this change we but everything into namespace 0 (so is_function() always returned true).
cranelift-simplejit/src/backend.rs::get_definition:
callsnamespace.is_function(name)
to figure out if it has to lookup a function or data definition. But cranelift-module is_function() does this by comparing the namespace with 0: