Fix MIR builder me-call recursion and add compile tracing
This commit is contained in:
@ -314,6 +314,24 @@ impl MirBuilder {
|
||||
self.debug_scope_stack.last().cloned()
|
||||
}
|
||||
|
||||
// ----------------------
|
||||
// Compile trace helpers (dev only; env-gated)
|
||||
// ----------------------
|
||||
#[inline]
|
||||
pub(super) fn compile_trace_enabled() -> bool {
|
||||
std::env::var("NYASH_MIR_COMPILE_TRACE")
|
||||
.ok()
|
||||
.as_deref()
|
||||
== Some("1")
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub(super) fn trace_compile<S: AsRef<str>>(&self, msg: S) {
|
||||
if Self::compile_trace_enabled() {
|
||||
eprintln!("[mir-compile] {}", msg.as_ref());
|
||||
}
|
||||
}
|
||||
|
||||
// ----------------------
|
||||
// Method tail index (performance helper)
|
||||
// ----------------------
|
||||
|
||||
Reference in New Issue
Block a user