Files
hakorune/src
tomoaki e7f9adcfed refactor(joinir): Phase 260 P0.3 Phase 1 - extract terminator_builder + block_finalizer
Extracts shared utilities from joinir_block_converter.rs to prepare for
handler extraction (Phase 2):

**terminator_builder.rs** (207 lines):
- create_branch_terminator() - Branch with empty edge_args
- emit_branch_and_finalize() - Branch + block finalization
- create_jump_terminator() - Jump with empty edge_args
- create_return_terminator() - Return terminator
- Eliminates 4x Branch terminator duplication

**block_finalizer.rs** (246 lines):
- finalize_block() - Add instructions + terminator (PHI-preserving)
- finalize_remaining_instructions() - Flush pending instructions
- Phase 189 FIX: Critical PHI preservation logic
- PHI instructions remain at block start for SSA correctness

Pattern reduction: ~90 lines duplicated 4x → 2 utility modules

All utilities fully tested with comprehensive unit tests.
Phase 1 complete - utilities ready for Phase 2 handler extraction.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-21 07:40:05 +09:00
..