tests(macro): inline samples into new directory hierarchy and drop legacy macro_golden_* sources

This commit is contained in:
Selfhosting Dev
2025-09-20 03:37:20 +09:00
parent 3c1486e411
commit 8cb93b9f1f
48 changed files with 142 additions and 132 deletions

View File

@ -124,6 +124,9 @@ pub struct MirBuilder {
/// Policy flags (snapshotted at entry of try/catch lowering)
pub(super) cleanup_allow_return: bool,
pub(super) cleanup_allow_throw: bool,
/// Hint sink (zero-cost guidance; currently no-op)
pub(super) hint_sink: crate::mir::hints::HintSink,
}
impl MirBuilder {
@ -160,6 +163,7 @@ impl MirBuilder {
in_cleanup_block: false,
cleanup_allow_return: false,
cleanup_allow_throw: false,
hint_sink: crate::mir::hints::HintSink::new(),
}
}
@ -167,6 +171,18 @@ impl MirBuilder {
pub(super) fn push_if_merge(&mut self, bb: BasicBlockId) { self.if_merge_stack.push(bb); }
pub(super) fn pop_if_merge(&mut self) { let _ = self.if_merge_stack.pop(); }
// ---- Hint helpers (no-op by default) ----
#[inline]
pub(crate) fn hint_loop_header(&mut self) { self.hint_sink.loop_header(); }
#[inline]
pub(crate) fn hint_loop_latch(&mut self) { self.hint_sink.loop_latch(); }
#[inline]
pub(crate) fn hint_scope_enter(&mut self, id: u32) { self.hint_sink.scope_enter(id); }
#[inline]
pub(crate) fn hint_scope_leave(&mut self, id: u32) { self.hint_sink.scope_leave(id); }
#[inline]
pub(crate) fn hint_join_result<S: Into<String>>(&mut self, var: S) { self.hint_sink.join_result(var.into()); }
// moved to builder_calls.rs: lower_method_as_function
/// Build a complete MIR module from AST