Remove debugging-related code
This commit is contained in:
parent
026a67377f
commit
b763f9094f
5 changed files with 4 additions and 18 deletions
|
@ -22,8 +22,6 @@ use crate::interpret::{
|
||||||
RefTracking, StackPopCleanup,
|
RefTracking, StackPopCleanup,
|
||||||
};
|
};
|
||||||
|
|
||||||
use tracing::info;
|
|
||||||
|
|
||||||
const NOTE_ON_UNDEFINED_BEHAVIOR_ERROR: &str = "The rules on what exactly is undefined behavior aren't clear, \
|
const NOTE_ON_UNDEFINED_BEHAVIOR_ERROR: &str = "The rules on what exactly is undefined behavior aren't clear, \
|
||||||
so this check might be overzealous. Please open an issue on the rustc \
|
so this check might be overzealous. Please open an issue on the rustc \
|
||||||
repository if you believe it should not be considered undefined behavior.";
|
repository if you believe it should not be considered undefined behavior.";
|
||||||
|
@ -35,7 +33,6 @@ fn eval_body_using_ecx<'mir, 'tcx>(
|
||||||
body: &'mir mir::Body<'tcx>,
|
body: &'mir mir::Body<'tcx>,
|
||||||
) -> InterpResult<'tcx, MPlaceTy<'tcx>> {
|
) -> InterpResult<'tcx, MPlaceTy<'tcx>> {
|
||||||
debug!("eval_body_using_ecx: {:?}, {:?}", cid, ecx.param_env);
|
debug!("eval_body_using_ecx: {:?}, {:?}", cid, ecx.param_env);
|
||||||
info!("HERE body is {:#?}", body);
|
|
||||||
let tcx = *ecx.tcx;
|
let tcx = *ecx.tcx;
|
||||||
assert!(
|
assert!(
|
||||||
cid.promoted.is_some()
|
cid.promoted.is_some()
|
||||||
|
|
|
@ -369,7 +369,6 @@ impl<'mir, 'tcx> interpret::Machine<'mir, 'tcx> for CompileTimeInterpreter<'mir,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[instrument(skip(ecx), ret)]
|
|
||||||
fn load_mir(
|
fn load_mir(
|
||||||
ecx: &InterpCx<'mir, 'tcx, Self>,
|
ecx: &InterpCx<'mir, 'tcx, Self>,
|
||||||
instance: ty::InstanceDef<'tcx>,
|
instance: ty::InstanceDef<'tcx>,
|
||||||
|
|
|
@ -129,7 +129,6 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
|
||||||
// FIXME(#73156): Handle source code coverage in const eval
|
// FIXME(#73156): Handle source code coverage in const eval
|
||||||
Coverage(..) => {}
|
Coverage(..) => {}
|
||||||
|
|
||||||
// FIXME(bryangarza): Update this to do some logic!!!
|
|
||||||
ConstEvalCounter => {
|
ConstEvalCounter => {
|
||||||
self.increment_const_eval_counter();
|
self.increment_const_eval_counter();
|
||||||
}
|
}
|
||||||
|
|
|
@ -441,14 +441,10 @@ impl<'tcx> TyCtxt<'tcx> {
|
||||||
|
|
||||||
#[inline]
|
#[inline]
|
||||||
pub fn mir_for_ctfe_opt_const_arg(self, def: ty::WithOptConstParam<DefId>) -> &'tcx Body<'tcx> {
|
pub fn mir_for_ctfe_opt_const_arg(self, def: ty::WithOptConstParam<DefId>) -> &'tcx Body<'tcx> {
|
||||||
let res = if let Some((did, param_did)) = def.as_const_arg() {
|
if let Some((did, param_did)) = def.as_const_arg() {
|
||||||
info!("calling mir_for_ctfe_of_const_arg for DedId {did:?}");
|
|
||||||
self.mir_for_ctfe_of_const_arg((did, param_did))
|
self.mir_for_ctfe_of_const_arg((did, param_did))
|
||||||
} else {
|
} else {
|
||||||
info!("calling mir_for_ctfe for DefId {:?}", def.did);
|
|
||||||
self.mir_for_ctfe(def.did)
|
self.mir_for_ctfe(def.did)
|
||||||
};
|
}
|
||||||
//info!("RES OF CALLING MIR_FOR_CTFE_OPT_CONST_ARG: {:#?}", res);
|
|
||||||
res
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -350,14 +350,11 @@ fn mir_promoted(
|
||||||
/// Compute the MIR that is used during CTFE (and thus has no optimizations run on it)
|
/// Compute the MIR that is used during CTFE (and thus has no optimizations run on it)
|
||||||
fn mir_for_ctfe(tcx: TyCtxt<'_>, def_id: DefId) -> &Body<'_> {
|
fn mir_for_ctfe(tcx: TyCtxt<'_>, def_id: DefId) -> &Body<'_> {
|
||||||
let did = def_id.expect_local();
|
let did = def_id.expect_local();
|
||||||
let body = if let Some(def) = ty::WithOptConstParam::try_lookup(did, tcx) {
|
if let Some(def) = ty::WithOptConstParam::try_lookup(did, tcx) {
|
||||||
tcx.mir_for_ctfe_of_const_arg(def)
|
tcx.mir_for_ctfe_of_const_arg(def)
|
||||||
} else {
|
} else {
|
||||||
tcx.arena.alloc(inner_mir_for_ctfe(tcx, ty::WithOptConstParam::unknown(did)))
|
tcx.arena.alloc(inner_mir_for_ctfe(tcx, ty::WithOptConstParam::unknown(did)))
|
||||||
};
|
}
|
||||||
//info!("MIR_FOR_CTFE (DefId = {def_id:?}) body res: {:#?}", body);
|
|
||||||
info!("MIR_FOR_CTFE (DefId = {def_id:?})");
|
|
||||||
body
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Same as `mir_for_ctfe`, but used to get the MIR of a const generic parameter.
|
/// Same as `mir_for_ctfe`, but used to get the MIR of a const generic parameter.
|
||||||
|
@ -451,7 +448,6 @@ fn mir_drops_elaborated_and_const_checked(
|
||||||
|
|
||||||
run_analysis_to_runtime_passes(tcx, &mut body);
|
run_analysis_to_runtime_passes(tcx, &mut body);
|
||||||
|
|
||||||
//info!("MIR after runtime passes: {:#?}", body);
|
|
||||||
tcx.alloc_steal_mir(body)
|
tcx.alloc_steal_mir(body)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -623,7 +619,6 @@ fn inner_optimized_mir(tcx: TyCtxt<'_>, did: LocalDefId) -> Body<'_> {
|
||||||
let mut body = remap_mir_for_const_eval_select(tcx, body, hir::Constness::NotConst);
|
let mut body = remap_mir_for_const_eval_select(tcx, body, hir::Constness::NotConst);
|
||||||
debug!("body: {:#?}", body);
|
debug!("body: {:#?}", body);
|
||||||
run_optimization_passes(tcx, &mut body);
|
run_optimization_passes(tcx, &mut body);
|
||||||
//info!("body after OPTIMIZATION: {:#?}", body);
|
|
||||||
|
|
||||||
debug_assert!(!body.has_free_regions(), "Free regions in optimized MIR");
|
debug_assert!(!body.has_free_regions(), "Free regions in optimized MIR");
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue