feat(joinir): Task 200-2 - JoinInlineBoundaryBuilder implementation for Pattern2
Builder pattern for JoinInlineBoundary construction, reduces field manipulation scattering. # Changes - NEW: src/mir/join_ir/lowering/inline_boundary_builder.rs (165 lines) - JoinInlineBoundaryBuilder with 7 fluent methods - Complete unit test coverage (4 tests) - MODIFIED: src/mir/join_ir/lowering/mod.rs (+2 lines) - Export inline_boundary_builder module - Public re-export of JoinInlineBoundaryBuilder - MODIFIED: src/mir/builder/control_flow/joinir/patterns/pattern2_with_break.rs - Replace direct boundary field manipulation with builder pattern - 9 lines of field assignments → fluent builder chain # Benefits - **Centralized**: All boundary construction logic in builder - **Readable**: Fluent API shows construction intent clearly - **Maintainable**: Changes to boundary structure isolated to builder - **Type Safe**: Builder validates field consistency # Tests ✅ All builder unit tests pass (4/4) ✅ All pattern module tests pass (30+) ✅ Library build succeeds with no errors 🤖 Generated with Claude Code (https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
@ -157,7 +157,49 @@ loop (i < n) {
|
||||
|
||||
---
|
||||
|
||||
## 5. 関連ドキュメント
|
||||
## 5. Pattern × Box マトリクス(Phase 200 追加)
|
||||
|
||||
各 Pattern がどの Box を使うかを一覧にしたよ。
|
||||
これで Claude / ChatGPT / 将来の自分が「このパターンはどの箱を使うか」をすぐ把握できる。
|
||||
|
||||
| Box / Module | P1 Minimal | P2 Break | P3 If‑PHI | P4 Continue | P5 Trim‑like* |
|
||||
|--------------------------------------|------------|----------|-----------|-------------|---------------|
|
||||
| **ConditionEnv** | ✅ | ✅ | ✅ | ✅ | ✅ |
|
||||
| **BoolExprLowerer** | ✅ | ✅ | ✅ | ✅ | ✅ |
|
||||
| **LoopConditionScopeBox** | ✅ | ✅ | ✅ | ✅ | ✅ |
|
||||
| **LoopScopeShapeBuilder** | ✅ | ✅ | ✅ | ✅ | ✅ |
|
||||
| **ConditionEnvBuilder** | ✅ | ✅ | ✅ | ✅ | ✅ |
|
||||
| **LoopHeaderPhiBuilder** | ✅ | ✅ | ✅ | ✅ | ✅ |
|
||||
| **ExitMeta / ExitMetaCollector** | ✅ | ✅ | ✅ | ✅ | ✅ |
|
||||
| **ExitLine / ExitLineReconnector** | ✅ | ✅ | ✅ | ✅ | ✅ |
|
||||
| **JoinInlineBoundary** | ✅ | ✅ | ✅ | ✅ | ✅ |
|
||||
| **BreakConditionAnalyzer** | ❌ | ✅ | ❌ | ❌ | ✅ |
|
||||
| **Pattern4CarrierAnalyzer** | ❌ | ❌ | ❌ | ✅ | ❌ |
|
||||
| **ContinueBranchNormalizer** | ❌ | ❌ | ❌ | ✅ | ❌ |
|
||||
| **LoopUpdateAnalyzer** | ❌ | ❌ | ❌ | ✅ | ❌ |
|
||||
| **LoopBodyCarrierPromoter** | ❌ | ❌ | ❌ | ❌ | ✅ |
|
||||
| **TrimLoopHelper** | ❌ | ❌ | ❌ | ❌ | ✅ |
|
||||
| **TrimPatternValidator** | ❌ | ❌ | ❌ | ❌ | ✅ |
|
||||
| **TrimPatternLowerer** | ❌ | ❌ | ❌ | ❌ | ✅ |
|
||||
| **BlockAllocator** (merge) | ✅ | ✅ | ✅ | ✅ | ✅ |
|
||||
| **ValueCollector** (merge) | ✅ | ✅ | ✅ | ✅ | ✅ |
|
||||
| **InstructionRewriter** (merge) | ✅ | ✅ | ✅ | ✅ | ✅ |
|
||||
| **ExitPhiBuilder** (merge) | ✅ | ✅ | ✅ | ✅ | ✅ |
|
||||
|
||||
**凡例**:
|
||||
- ✅: 使用する(必須)
|
||||
- ❌: 使用しない
|
||||
- 🔮: 将来的に使用予定(設計段階)
|
||||
|
||||
**備考**:
|
||||
- P5 (Trim‑like) は Phase 171‑172 で validation + JoinIR lowering まで完了。
|
||||
- P6〜P12(break+continue 同時、複数キャリア、match‑PHI など)は将来パターンとして識別済み。
|
||||
- すべての Pattern は **LoopConditionScopeBox** で条件変数のスコープを分類する(Fail‑Fast の要)。
|
||||
- **TrimLoopHelper / TrimPatternValidator / TrimPatternLowerer** は P5 専用(他パターンには影響しない)。
|
||||
|
||||
---
|
||||
|
||||
## 6. 関連ドキュメント
|
||||
|
||||
- `joinir-architecture-overview.md`
|
||||
JoinIR 全体の箱と契約。Loop/If/ExitLine/Boundary/条件式ラインの全体図。
|
||||
|
||||
Reference in New Issue
Block a user