llvm2cranelift
llvm2cranelift copied to clipboard
symbols: put data symbols into namespace 1 and funcs into 0
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)
}
}
This makes sense to me.
rebased the PR - no other changes
is there anything to do to get this merged?