Skip to content

Commit 473f908

Browse files
committed
rustc_codegen_ssa: make codegen_instance a simple wrapper for codegen_mir.
1 parent 4e15e2e commit 473f908

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
@@ -119,13 +119,16 @@ impl<'a, 'tcx, V: CodegenObject> LocalRef<'tcx, V> {
119119

120120
pub fn codegen_mir<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>>(
121121
cx: &'a Bx::CodegenCx,
122-
llfn: Bx::Function,
123-
mir: &'tcx mir::Body<'tcx>,
124122
instance: Instance<'tcx>,
125-
sig: ty::FnSig<'tcx>,
126123
) {
127124
assert!(!instance.substs.needs_infer());
128125

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

0 commit comments

Comments
 (0)