rustc_codegen_ssa: use FnAbi::of_instance wherever possible.
This commit is contained in:
parent
5b7d0f389f
commit
4b68afe257
5 changed files with 34 additions and 30 deletions
|
|
@ -129,13 +129,10 @@ pub fn codegen_mir<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>>(
|
|||
|
||||
let mir = cx.tcx().instance_mir(instance.def);
|
||||
|
||||
let sig = instance.fn_sig(cx.tcx());
|
||||
let sig = cx.tcx().normalize_erasing_late_bound_regions(ty::ParamEnv::reveal_all(), &sig);
|
||||
let fn_abi = FnAbi::new(cx, sig, &[]);
|
||||
let fn_abi = FnAbi::of_instance(cx, instance);
|
||||
debug!("fn_abi: {:?}", fn_abi);
|
||||
|
||||
let debug_context =
|
||||
cx.create_function_debug_context(instance, sig, llfn, &mir);
|
||||
let debug_context = cx.create_function_debug_context(instance, &fn_abi, llfn, &mir);
|
||||
|
||||
let mut bx = Bx::new_block(cx, llfn, "start");
|
||||
|
||||
|
|
|
|||
|
|
@ -2,8 +2,9 @@ use super::BackendTypes;
|
|||
use crate::mir::debuginfo::{FunctionDebugContext, VariableKind};
|
||||
use rustc::hir::def_id::CrateNum;
|
||||
use rustc::mir;
|
||||
use rustc::ty::{self, Ty, Instance};
|
||||
use rustc::ty::{Ty, Instance};
|
||||
use rustc::ty::layout::Size;
|
||||
use rustc_target::abi::call::FnAbi;
|
||||
use syntax::ast::Name;
|
||||
use syntax_pos::{SourceFile, Span};
|
||||
|
||||
|
|
@ -17,7 +18,7 @@ pub trait DebugInfoMethods<'tcx>: BackendTypes {
|
|||
fn create_function_debug_context(
|
||||
&self,
|
||||
instance: Instance<'tcx>,
|
||||
sig: ty::FnSig<'tcx>,
|
||||
fn_abi: &FnAbi<'tcx, Ty<'tcx>>,
|
||||
llfn: Self::Function,
|
||||
mir: &mir::Body<'_>,
|
||||
) -> Option<FunctionDebugContext<Self::DIScope>>;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue