Skip to content
Permalink
Browse files

rustc_codegen_ssa: make codegen_instance a simple wrapper for codegen…

…_mir.
  • Loading branch information
eddyb committed Oct 29, 2019
1 parent a7094f7 commit fce40a22569d31dcb20b4bc9505d835f12278d98
Showing with 7 additions and 10 deletions.
  1. +1 −7 src/librustc_codegen_ssa/base.rs
  2. +6 −3 src/librustc_codegen_ssa/mir/mod.rs
@@ -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);

0 comments on commit fce40a2

Please sign in to comment.
You can’t perform that action at this time.