Address review comments

This commit is contained in:
Oliver Scherer 2020-08-18 13:44:57 +02:00
parent de7c836607
commit 03d38d42b7
4 changed files with 5 additions and 5 deletions

View File

@ -101,7 +101,7 @@ pub enum MirPhase {
/// After this phase, generators are explicit state machines (no more `Yield`).
/// `AggregateKind::Generator` is gone for good.
GeneratorLowering = 4,
Optimized = 5,
Optimization = 5,
}
impl MirPhase {

View File

@ -436,7 +436,7 @@ impl<'mir, 'tcx: 'mir, M: super::intern::CompileTimeMachine<'mir, 'tcx>> InterpC
/// A helper function that allocates memory for the layout given and gives you access to mutate
/// it. Once your own mutation code is done, the backing `Allocation` is removed from the
/// current `Memory` and returned.
pub(crate) fn with_temp_alloc(
pub(crate) fn intern_with_temp_alloc(
&mut self,
layout: TyAndLayout<'tcx>,
f: impl FnOnce(

View File

@ -845,7 +845,7 @@ impl<'mir, 'tcx> ConstPropagator<'mir, 'tcx> {
if ty_is_scalar(ty1) && ty_is_scalar(ty2) {
let alloc = this
.ecx
.with_temp_alloc(value.layout, |ecx, dest| {
.intern_with_temp_alloc(value.layout, |ecx, dest| {
ecx.write_immediate_to_mplace(*imm, dest)
})
.unwrap();

View File

@ -228,7 +228,7 @@ pub fn run_passes(
body.phase = mir_phase;
if mir_phase == MirPhase::Optimized {
if mir_phase == MirPhase::Optimization {
validate::Validator { when: format!("end of phase {:?}", mir_phase), mir_phase }
.run_pass(tcx, source, body);
}
@ -504,7 +504,7 @@ fn run_optimization_passes<'tcx>(
body,
InstanceDef::Item(ty::WithOptConstParam::unknown(def_id.to_def_id())),
promoted,
MirPhase::Optimized,
MirPhase::Optimization,
&[
if mir_opt_level > 0 { optimizations } else { no_optimizations },
pre_codegen_cleanup,