refactor(joinir): Phase 229 - Remove redundant ConditionAlias
Replace static alias mapping with dynamic condition variable resolution using: - promoted_loopbodylocals as source of truth - Naming conventions: is_<var> or is_<var>_match - Pattern-aware inference during lowering Benefits: - Simpler data structure (6 fields → 5) - Single source of truth - Self-documenting with explicit naming conventions - Fewer maintenance points Net: -25 lines (60 additions, 85 deletions) Tests: 877/884 PASS (no regressions) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@ -83,11 +83,9 @@ impl TrimPatternInfo {
|
||||
// Phase 171-C-5: Attach TrimLoopHelper for pattern-specific lowering logic
|
||||
carrier_info.trim_helper = Some(TrimLoopHelper::from_pattern_info(self));
|
||||
|
||||
// Phase 224-D: Record condition alias for promoted variable
|
||||
carrier_info.condition_aliases.push(crate::mir::join_ir::lowering::carrier_info::ConditionAlias {
|
||||
old_name: self.var_name.clone(),
|
||||
carrier_name: self.carrier_name.clone(),
|
||||
});
|
||||
// Phase 229: Record promoted variable (no need for condition_aliases)
|
||||
// Dynamic resolution uses promoted_loopbodylocals + naming convention
|
||||
carrier_info.promoted_loopbodylocals.push(self.var_name.clone());
|
||||
|
||||
carrier_info
|
||||
}
|
||||
|
||||
@ -199,18 +199,16 @@ impl DigitPosPromoter {
|
||||
vec![promoted_carrier],
|
||||
);
|
||||
|
||||
// Phase 224-D: Record condition alias for promoted variable
|
||||
carrier_info.condition_aliases.push(crate::mir::join_ir::lowering::carrier_info::ConditionAlias {
|
||||
old_name: var_in_cond.clone(),
|
||||
carrier_name: carrier_name.clone(),
|
||||
});
|
||||
// Phase 229: Record promoted variable (no need for condition_aliases)
|
||||
// Dynamic resolution uses promoted_loopbodylocals + naming convention
|
||||
carrier_info.promoted_loopbodylocals.push(var_in_cond.clone());
|
||||
|
||||
eprintln!(
|
||||
"[digitpos_promoter] A-4 DigitPos pattern promoted: {} → {}",
|
||||
var_in_cond, carrier_name
|
||||
);
|
||||
eprintln!(
|
||||
"[digitpos_promoter] Phase 224-D: Added condition alias '{}' → '{}'",
|
||||
"[digitpos_promoter] Phase 229: Recorded promoted variable '{}' (carrier: '{}')",
|
||||
var_in_cond, carrier_name
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user