From 6d0b4e3bfd6e461907332794802dfd50221b39e5 Mon Sep 17 00:00:00 2001 From: nyash-codex Date: Mon, 8 Dec 2025 19:17:34 +0900 Subject: [PATCH] refactor(joinir): Document loop pattern detection architecture (Task 2) Task 2: Loop pattern detection structure investigation - Analyzed src/mir/loop_pattern_detection/ (~3k lines, not 26k as expected) - Module is already well-structured with Phase 194+ architecture - Legacy functions (Phase 188) are still actively used, not truly deprecated - Added clarifying comment to prevent future confusion about "legacy" label Decision: Skip reorganization - current structure is clean and functional. No subdirectory needed for active production code. --- src/mir/loop_pattern_detection/mod.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/mir/loop_pattern_detection/mod.rs b/src/mir/loop_pattern_detection/mod.rs index c353b4fb..ecd72a97 100644 --- a/src/mir/loop_pattern_detection/mod.rs +++ b/src/mir/loop_pattern_detection/mod.rs @@ -329,6 +329,12 @@ pub fn classify_with_diagnosis(features: &LoopFeatures) -> (LoopPatternKind, Str // ============================================================================ // Legacy Detection Functions (Phase 188) // ============================================================================ +// +// NOTE (Phase 179): These functions are still actively used by pattern lowerers. +// The term "legacy" refers to Phase 188 implementation style (name-based detection), +// not deprecation status. Do NOT move to legacy/ subdirectory - still production code. +// +// Future work: Gradually migrate to Phase 194+ structure-based detection (extract_features/classify). // ============================================================================ // Pattern 1: Simple While Loop