Skip to content

Commit fce40a2

Browse files
committed
rustc_codegen_ssa: make codegen_instance a simple wrapper for codegen_mir.
1 parent a7094f7 commit fce40a2

File tree

2 files changed

+7
-10
lines changed

2 files changed

+7
-10
lines changed

src/librustc_codegen_ssa/base.rs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -368,13 +368,7 @@ pub fn codegen_instance<'a, 'tcx: 'a, Bx: BuilderMethods<'a, 'tcx>>(
368368
// release builds.
369369
info!("codegen_instance({})", instance);
370370

371-
let sig = instance.fn_sig(cx.tcx());
372-
let sig = cx.tcx().normalize_erasing_late_bound_regions(ty::ParamEnv::reveal_all(), &sig);
373-
374-
let lldecl = cx.get_fn(instance);
375-
376-
let mir = cx.tcx().instance_mir(instance.def);
377-
mir::codegen_mir::<Bx>(cx, lldecl, mir, instance, sig);
371+
mir::codegen_mir::<Bx>(cx, instance);
378372
}
379373

380374
/// Creates the `main` function which will initialize the rust runtime and call

src/librustc_codegen_ssa/mir/mod.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -121,13 +121,16 @@ impl<'a, 'tcx, V: CodegenObject> LocalRef<'tcx, V> {
121121

122122
pub fn codegen_mir<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>>(
123123
cx: &'a Bx::CodegenCx,
124-
llfn: Bx::Function,
125-
mir: mir::ReadOnlyBodyCache<'tcx, 'tcx>,
126124
instance: Instance<'tcx>,
127-
sig: ty::FnSig<'tcx>,
128125
) {
129126
assert!(!instance.substs.needs_infer());
130127

128+
let llfn = cx.get_fn(instance);
129+
130+
let mir = cx.tcx().instance_mir(instance.def);
131+
132+
let sig = instance.fn_sig(cx.tcx());
133+
let sig = cx.tcx().normalize_erasing_late_bound_regions(ty::ParamEnv::reveal_all(), &sig);
131134
let fn_abi = FnAbi::new(cx, sig, &[]);
132135
debug!("fn_abi: {:?}", fn_abi);
133136

0 commit comments

Comments
 (0)