rustc: compute FnAbi's for virtual calls through FnAbi::of_instance.

This commit is contained in:
Eduard-Mihai Burtescu 2019-10-29 21:46:25 +02:00
parent 39e50e2f28
commit 052d0edbc1
5 changed files with 37 additions and 37 deletions

View file

@ -40,7 +40,7 @@ pub fn get_fn(
let sym = tcx.symbol_name(instance).name.as_str();
debug!("get_fn({:?}: {:?}) => {}", instance, instance.ty(cx.tcx()), sym);
let fn_abi = FnAbi::of_instance(cx, instance);
let fn_abi = FnAbi::of_instance(cx, instance, &[]);
let llfn = if let Some(llfn) = cx.get_declared_value(&sym) {
// Create a fn pointer with the new signature.

View file

@ -43,7 +43,7 @@ impl PreDefineMethods<'tcx> for CodegenCx<'ll, 'tcx> {
assert!(!instance.substs.needs_infer() &&
!instance.substs.has_param_types());
let fn_abi = FnAbi::of_instance(self, instance);
let fn_abi = FnAbi::of_instance(self, instance, &[]);
let lldecl = self.declare_fn(symbol_name, &fn_abi);
unsafe { llvm::LLVMRustSetLinkage(lldecl, base::linkage_to_llvm(linkage)) };
let attrs = self.tcx.codegen_fn_attrs(instance.def_id());