Skip to content

Commit 4ae3542

Browse files
committed
Use worse MIR for incr comp
1 parent 5ee22f1 commit 4ae3542

File tree

3 files changed

+10
-2
lines changed

3 files changed

+10
-2
lines changed

compiler/rustc_codegen_ssa/src/base.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -416,7 +416,7 @@ pub(crate) fn codegen_instance<'a, 'tcx: 'a, Bx: BuilderMethods<'a, 'tcx>>(
416416
// release builds.
417417
info!("codegen_instance({})", instance);
418418

419-
mir::codegen_mir::<Bx>(cx, instance);
419+
mir::lower_mir::<Bx>(cx, instance);
420420
}
421421

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

compiler/rustc_codegen_ssa/src/mir/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ impl<'tcx, V: CodegenObject> LocalRef<'tcx, V> {
159159
///////////////////////////////////////////////////////////////////////////
160160

161161
#[instrument(level = "debug", skip(cx))]
162-
pub fn codegen_mir<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>>(
162+
pub fn lower_mir<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>>(
163163
cx: &'a Bx::CodegenCx,
164164
instance: Instance<'tcx>,
165165
) {

compiler/rustc_middle/src/ty/mod.rs

+8
Original file line numberDiff line numberDiff line change
@@ -1718,6 +1718,14 @@ impl<'tcx> TyCtxt<'tcx> {
17181718
}
17191719
}
17201720

1721+
pub fn codegen_mir(self, instance: ty::Instance<'tcx>) -> &'tcx Body<'tcx> {
1722+
if self.sess.opts.incremental == None {
1723+
self.build_codegen_mir(instance)
1724+
} else {
1725+
self.instance_mir(instance.def)
1726+
}
1727+
}
1728+
17211729
/// Returns the possibly-auto-generated MIR of a [`ty::InstanceKind`].
17221730
#[instrument(skip(self), level = "debug")]
17231731
pub fn instance_mir(self, instance: ty::InstanceKind<'tcx>) -> &'tcx Body<'tcx> {

0 commit comments

Comments
 (0)