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

@ -62,8 +62,11 @@ impl MirBuilder {
self.ensure_block_exists(merge_block)?;
self.push_if_merge(merge_block);
// Pre-analysis: identify then-assigned var for skip
// Pre-analysis: identify then/else assigned var for skip and hints
let assigned_then_pre = super::phi::extract_assigned_var(&then_ast_for_analysis);
let assigned_else_pre = else_ast_for_analysis
.as_ref()
.and_then(|e| super::phi::extract_assigned_var(e));
let pre_then_var_value = assigned_then_pre
.as_ref()
.and_then(|name| pre_if_var_map.get(name).copied());
@ -83,6 +86,13 @@ impl MirBuilder {
pre_then_var_value,
)?;
// Hint: join result variable if both branches assign to the same variable name
if let (Some(tn), Some(en)) = (assigned_then_pre.as_deref(), assigned_else_pre.as_deref()) {
if tn == en {
self.hint_join_result(tn);
}
}
// Merge other modified variables (skip the primary assignment if any)
let skip_name = assigned_then_pre.as_deref();
self.merge_modified_vars(