rustc_codegen_ssa: make codegen_instance a simple wrapper for codegen_mir.
This commit is contained in:
parent
a7094f7ce3
commit
fce40a2256
@ -368,13 +368,7 @@ pub fn codegen_instance<'a, 'tcx: 'a, Bx: BuilderMethods<'a, 'tcx>>(
|
||||
// release builds.
|
||||
info!("codegen_instance({})", instance);
|
||||
|
||||
let sig = instance.fn_sig(cx.tcx());
|
||||
let sig = cx.tcx().normalize_erasing_late_bound_regions(ty::ParamEnv::reveal_all(), &sig);
|
||||
|
||||
let lldecl = cx.get_fn(instance);
|
||||
|
||||
let mir = cx.tcx().instance_mir(instance.def);
|
||||
mir::codegen_mir::<Bx>(cx, lldecl, mir, instance, sig);
|
||||
mir::codegen_mir::<Bx>(cx, instance);
|
||||
}
|
||||
|
||||
/// Creates the `main` function which will initialize the rust runtime and call
|
||||
|
@ -121,13 +121,16 @@ impl<'a, 'tcx, V: CodegenObject> LocalRef<'tcx, V> {
|
||||
|
||||
pub fn codegen_mir<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>>(
|
||||
cx: &'a Bx::CodegenCx,
|
||||
llfn: Bx::Function,
|
||||
mir: mir::ReadOnlyBodyCache<'tcx, 'tcx>,
|
||||
instance: Instance<'tcx>,
|
||||
sig: ty::FnSig<'tcx>,
|
||||
) {
|
||||
assert!(!instance.substs.needs_infer());
|
||||
|
||||
let llfn = cx.get_fn(instance);
|
||||
|
||||
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, &[]);
|
||||
debug!("fn_abi: {:?}", fn_abi);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user