Files
hakorune/src/mir
tomoaki 3cdeb95cbc refactor(joinir): Eliminate block allocation duplication with BlockAllocator
Problem:
- joinir_block_converter.rs had 4 duplicate block allocation patterns
- Lines 260-265, 487-489, 635-639, 740-748 all manually allocating BasicBlockIds
- Total duplication: 27 lines across 4 sites

Solution:
- Use existing BlockAllocator (Phase 260 P0.2) for all block allocations
- Replace manual patterns with allocate_two(), allocate_three(), allocate_n()

Changes:
- Site 1/4 (handle_conditional_method_call): 6 lines → 3 lines (-3)
- Site 2/4 (handle_jump): 4 lines → 3 lines (-1)
- Site 3/4 (handle_if_merge): 6 lines → 3 lines (-3)
- Site 4/4 (handle_nested_if_merge): 11 lines → 8 lines (-3)

Result:
-  10 lines eliminated
-  Improved readability (clear intent)
-  Improved maintainability (SSOT for allocation)
-  No behavior change (all tests pass)
-  No regression: phase269_p1_2, phase259_p0, phase269_p0 PASS

Follow-up potential:
- MergeVariableHandlerBox duplication (lines 652-660, 667-675, 785-791, 800-806)
- CallInstructionGeneratorBox duplication (lines 403-406, 511-514, 536-546)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-22 03:58:12 +09:00
..