refactor(extractors): Phase 282 P9a - CommonExtractionHelpers SSOT統合(スコープ限定版)
# Phase 282 P9a 完了 (Scope-Limited Integration) ## 実装内容 - **common_helpers.rs 作成**: 4グループの共通ヘルパー統合 (316行) - Group 1: Control Flow Counting (count_control_flow - 汎用カウンター) - Group 2: Control Flow Detection (has_break/continue/return_statement) - Group 3: Condition Validation (extract_loop_variable, is_true_literal) - Group 4: Pattern5専用ヘルパー (validate_continue_at_end, validate_break_in_simple_if) - **Pattern統合完了**: Pattern5 → Pattern4 → Pattern2 → Pattern1 - Pattern5: ~90行削減 (5 tests PASS) - Pattern4: ~66行削減 (5 tests PASS) - Pattern2: ~67行削減 (4 tests PASS) - Pattern1: ~28行削減 (3 tests PASS) - Pattern3: 別フェーズに延期(pattern固有ロジック除外) ## 成果 - **コード削減**: ~251行(Pattern3除く、total ~400行見込み) - **テスト**: 40 unit tests PASS (23 common_helpers + 17 extractors) - **スモークテスト**: 45 PASS, 1 pre-existing FAIL(退行ゼロ) - **ビルド警告**: 130 → 120 (-10) ## USER CORRECTIONS適用済み 1. ✅ スコープ限定(共通ロジックのみ、pattern固有除外) 2. ✅ Placeholder禁止(SSOT違反排除) 3. ✅ 統合順序変更(Pattern3を最後/別フェーズへ) ## 追加ドキュメント - Phase 284 計画追加(Return as ExitKind SSOT) - 10-Now.md, 30-Backlog.md 更新 🎯 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
@ -8,9 +8,21 @@ Related:
|
||||
|
||||
## 直近(JoinIR/selfhost)
|
||||
|
||||
- **Phase 282(planned, design-first): Router shrinkage**
|
||||
- 入口: `docs/development/current/main/phases/phase-282/README.md`
|
||||
- 目的: pattern番号を “症状ラベル” に縮退し、router の責務を「抽出の配線」へ収束させる
|
||||
- **Phase 284(planned, design-first): Return as ExitKind SSOT(patternに散らさない)**
|
||||
- 目的: `return` を “pattern最適化の個別実装” にせず、`ExitKind` と `compose::*` / `emit_frag()` に収束させる
|
||||
- ねらい: 移行期間中の「二重ルール」「検出の穴」を減らし、将来の pattern 増殖を防ぐ
|
||||
- 入口: `docs/development/current/main/phases/phase-284/README.md`
|
||||
- P0(docs-only): `docs/development/current/main/phases/phase-284/P0-INSTRUCTIONS.md`
|
||||
- SSOT:
|
||||
- Composition: `src/mir/builder/control_flow/edgecfg/api/compose.rs`
|
||||
- Terminator emission: `emit_frag()`(`src/mir/builder/control_flow/edgecfg/api/emit.rs`)
|
||||
- Frag docs: `docs/development/current/main/design/edgecfg-fragments.md`
|
||||
- 進め方:
|
||||
- P0(docs-only)で “return の意味” と “Ok(None)/Err” の境界を固定
|
||||
- P1+ で Rust/LLVM の実装を SSOT に収束(pattern側に例外実装を増やさない)
|
||||
|
||||
- (✅ done)**Phase 282**: Router shrinkage + detection SSOT + extractor refactor
|
||||
- 完了: `docs/development/current/main/phases/phase-282/README.md`
|
||||
|
||||
(✅ done)**Phase 279 P0**: Type propagation pipeline SSOT 統一(lifecycle / JoinIR / LLVM の二重化解消)
|
||||
- 完了: `docs/development/current/main/phases/phase-279/README.md`
|
||||
|
||||
Reference in New Issue
Block a user