Files
hakorune/src/mir/builder/control_flow/debug.rs

24 lines
760 B
Rust
Raw Normal View History

//! Debug utilities for control flow tracing.
//!
//! This module provides diagnostic tools for tracing and debugging
//! control flow behavior during MIR construction.
//!
//! # Environment Variables
//!
//! - `NYASH_TRACE_VARMAP=1` - Enable variable map tracing
use super::super::MirBuilder;
impl MirBuilder {
/// Trace variable_map state for debugging
/// Enable with NYASH_TRACE_VARMAP=1
pub(in crate::mir::builder) fn trace_varmap(&self, context: &str) {
if std::env::var("NYASH_TRACE_VARMAP").is_ok() {
let vars: Vec<_> = self.variable_map.iter()
.map(|(k, v)| format!("{}={:?}", k, v))
.collect();
eprintln!("[varmap/{}] {{{}}}", context, vars.join(", "));
}
}
}