Fix the horrible no-good very bad u32 sub linkage

This commit is contained in:
khyperia 2020-09-11 16:08:01 +02:00
parent c5dfee6e1e
commit e26d1a7616
2 changed files with 6 additions and 16 deletions

View File

@ -725,21 +725,15 @@ impl<'tcx> PreDefineMethods<'tcx> for CodegenCx<'tcx> {
&self,
instance: Instance<'tcx>,
linkage: Linkage,
visibility: Visibility,
_visibility: Visibility,
symbol_name: &str,
) {
let fn_abi = FnAbi::of_instance(self, instance, &[]);
let human_name = format!("{}", instance);
if symbol_name == "_ZN51_$LT$i32$u20$as$u20$compiler_builtins..int..Int$GT$12extract_sign17h33d8e137c5cab7faE" {
println!("{} = {:?} {:?}", human_name, linkage, visibility);
}
let linkage = match visibility {
Visibility::Default | Visibility::Protected => Some(LinkageType::Export),
Visibility::Hidden => match linkage {
Linkage::External | Linkage::AvailableExternally => Some(LinkageType::Export),
// TODO: Figure out linkage types
_ => None,
},
let linkage = match linkage {
Linkage::External => Some(LinkageType::Export),
Linkage::Internal => None,
other => panic!("TODO: Linkage type not supported yet: {:?}", other),
};
let declared = declare_fn(self, symbol_name, Some(&human_name), linkage, &fn_abi);
self.instances.borrow_mut().insert(instance, declared);

View File

@ -112,15 +112,11 @@ impl CodegenBackend for SpirvCodegenBackend {
// Temp hack to make wasm target work
[("simd128".to_string(), None)].iter().cloned().collect()
};
providers.is_reachable_non_generic = |_tcx, _defid| true;
providers.exported_symbols = |_tcx, _crate| &[];
// Temp hack to make wasm target work
providers.wasm_import_module_map = |_tcx, _crate| Default::default();
}
fn provide_extern(&self, providers: &mut Providers) {
providers.is_reachable_non_generic = |_tcx, _defid| true;
}
fn provide_extern(&self, _providers: &mut Providers) {}
fn codegen_crate<'tcx>(
&self,