diff --git a/rap/src/analysis/core/alias/mop.rs b/rap/src/analysis/core/alias/mop.rs index cf01e1d..fdc9660 100644 --- a/rap/src/analysis/core/alias/mop.rs +++ b/rap/src/analysis/core/alias/mop.rs @@ -4,8 +4,8 @@ pub mod mop; pub mod types; use crate::analysis::core::alias::FnMap; -use crate::rap_debug; use crate::utils::source::*; +use crate::{rap_debug, rap_trace}; use graph::MopGraph; use rustc_data_structures::fx::FxHashMap; use rustc_data_structures::fx::FxHashSet; @@ -28,6 +28,7 @@ impl<'tcx> MopAlias<'tcx> { } pub fn start(&mut self) -> &FnMap { + rap_debug!("Start alias analysis via MoP."); for local_def_id in self.tcx.iter_local_def_id() { let hir_map = self.tcx.hir(); if hir_map.maybe_body_owned_by(local_def_id).is_some() { @@ -38,8 +39,7 @@ impl<'tcx> MopAlias<'tcx> { for (fn_id, fn_alias) in &self.fn_map { let fn_name = get_fn_name(self.tcx, *fn_id); if fn_alias.len() > 0 { - rap_debug!("{:?},{:?}", fn_name, fn_id); - rap_debug!("{}", fn_alias); + rap_debug!("Alias found in {:?}: {}", fn_name, fn_alias); } } &self.fn_map @@ -47,7 +47,7 @@ impl<'tcx> MopAlias<'tcx> { pub fn query_mop(&mut self, def_id: DefId) { let fn_name = get_fn_name(self.tcx, def_id); - rap_debug!("query_mop: {:?}", fn_name); + rap_trace!("query_mop: {:?}", fn_name); /* filter const mir */ if let Some(_other) = self.tcx.hir().body_const_context(def_id.expect_local()) { return; @@ -59,10 +59,10 @@ impl<'tcx> MopAlias<'tcx> { let mut recursion_set = FxHashSet::default(); mop_graph.check(0, &mut self.fn_map, &mut recursion_set); if mop_graph.visit_times > VISIT_LIMIT { - rap_debug!("Over visited: {:?}", def_id); + rap_trace!("Over visited: {:?}", def_id); } } else { - rap_debug!("mir is not available at {}", self.tcx.def_path_str(def_id)); + rap_trace!("mir is not available at {}", self.tcx.def_path_str(def_id)); } } } diff --git a/rap/src/analysis/core/heap_item/type_visitor.rs b/rap/src/analysis/core/heap_item/type_visitor.rs index b3c7591..776cba7 100644 --- a/rap/src/analysis/core/heap_item/type_visitor.rs +++ b/rap/src/analysis/core/heap_item/type_visitor.rs @@ -63,11 +63,7 @@ impl<'tcx, 'a> TypeAnalysis<'tcx, 'a> { EarlyBinder::skip_binder(ref_type_analysis.tcx().type_of(*elem.0)) ); let owning = format!("{:?}", elem.1); - rap_debug!( - "{} {}", - name.color(Color::Orange1), - owning.color(Color::Yellow3a) - ); + rap_debug!("ADT analysis: {} {}", name, owning); } } diff --git a/rap/src/bin/cargo-rap/args.rs b/rap/src/bin/cargo-rap/args.rs index d42c2b7..a72b0bd 100644 --- a/rap/src/bin/cargo-rap/args.rs +++ b/rap/src/bin/cargo-rap/args.rs @@ -53,7 +53,7 @@ impl Arguments { let args: Vec<_> = env::args().collect(); let path = env::current_exe().expect("Current executable path invalid."); - rap_debug!("Current exe: {path:?}\tReceived args: {args:?}"); + rap_trace!("Current exe: {path:?}\tReceived args: {args:?}"); let [args_group1, args_group2] = split_args_by_double_dash(&args); Arguments { diff --git a/rap/src/bin/cargo-rap/cargo_check.rs b/rap/src/bin/cargo-rap/cargo_check.rs index fd18507..8e54269 100644 --- a/rap/src/bin/cargo-rap/cargo_check.rs +++ b/rap/src/bin/cargo-rap/cargo_check.rs @@ -51,7 +51,7 @@ fn cargo_check(dir: &Utf8Path) { let cargo_rap_path = args::current_exe_path(); cmd.env("RUSTC_WRAPPER", cargo_rap_path); - rap_debug!("Command is: {:?}.", cmd); + rap_trace!("Command is: {:?}.", cmd); let mut child = cmd.spawn().expect("Could not run cargo check."); match child diff --git a/rap/src/bin/cargo-rap/utils.rs b/rap/src/bin/cargo-rap/utils.rs index f6b1897..2ab4b18 100644 --- a/rap/src/bin/cargo-rap/utils.rs +++ b/rap/src/bin/cargo-rap/utils.rs @@ -12,7 +12,7 @@ fn find_rap() -> PathBuf { } pub fn run_cmd(mut cmd: Command) { - rap_debug!("Command is: {:?}.", cmd); + rap_trace!("Command is: {:?}.", cmd); match cmd.status() { Ok(status) => { if !status.success() {