refactor(cleanup): Large-scale dead code elimination (Task 5)

Removed 966 lines of dead code identified by Rust compiler warnings.
4 files completely deleted, multiple pattern implementations cleaned up.

**Files Completely Deleted (4)**:
- src/mir/builder/control_flow/joinir/api/entry.rs (15 lines)
- src/mir/builder/control_flow/joinir/api/pipeline_contracts.rs (17 lines)
- src/mir/builder/control_flow/joinir/api/receiver.rs (21 lines)
- src/mir/builder/control_flow/joinir/patterns/pattern2_steps/promote_step_box.rs (33 lines)

**Pattern 7 (SplitScan) - 423 lines deleted**:
- Removed: can_lower(), lower(), cf_loop_pattern7_split_scan_impl()
- Removed helper functions: contains_methodcall(), contains_variable_step(), contains_push()
- Removed test code
- Kept: extract_split_scan_plan() (used by router.rs)

**Pattern 8 (BoolPredicate) - 222 lines deleted**:
- Removed: cf_loop_pattern8_bool_predicate_impl() (impl MirBuilder block)
- Kept: can_lower(), lower() (used by router.rs)

**Pattern 5 (InfiniteEarlyExit) - 95 lines deleted**:
- Removed: count_breaks_and_continues(), validate_continue_position(), validate_break_pattern()

**Pattern 6 (ScanWithInit) - 110 lines deleted**:
- Removed: contains_methodcall(), is_const_step_pattern()
- Removed 4 test functions

**JoinIR API - 53 lines deleted**:
- Removed module: api/entry.rs
- Removed module: api/pipeline_contracts.rs
- Removed module: api/receiver.rs

**EdgeCFG API - 30 lines deleted**:
- EdgeStub: Removed new(), with_target() methods

**Statistics**:
- Total lines deleted: 966
- Files deleted: 4
- Dead code warnings eliminated: Multiple pattern implementations

Build Status:  Release build successful (0 errors)

🤖 Generated with Claude Code

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
2025-12-24 04:49:52 +09:00
parent f1ff305c08
commit dac57ec350
12 changed files with 0 additions and 973 deletions

View File

@ -1,14 +0,0 @@
//! Entry function helpers (SSOT)
use crate::mir::join_ir::{JoinFunction, JoinModule};
/// Extract entry function from JoinModule (SSOT).
///
/// Priority: `join_module.entry` → fallback to `"main"`.
pub(in crate::mir::builder) fn get_entry_function<'a>(
join_module: &'a JoinModule,
context: &str,
) -> Result<&'a JoinFunction, String> {
// Re-exported from patterns/common as the SSOT entry point.
super::super::patterns::common::get_entry_function(join_module, context)
}

View File

@ -8,7 +8,3 @@
//! - Prefer SSOT helpers over ad-hoc logic in patterns.
//! - Avoid guessing (order/layout/name) in callers; callers pass explicit intent.
//! - Keep this module thin: mostly wrappers/re-exports with clear naming.
pub(in crate::mir::builder) mod entry;
pub(in crate::mir::builder) mod pipeline_contracts;
pub(in crate::mir::builder) mod receiver;

View File

@ -1,16 +0,0 @@
//! Pipeline contract helpers (SSOT)
use crate::mir::join_ir::lowering::inline_boundary::JoinInlineBoundary;
use crate::mir::join_ir::JoinModule;
/// Run all JoinIR pipeline contract checks (SSOT).
///
/// This is the preferred entry point for patterns that need to validate boundary
/// assumptions before bridge/merge.
pub(in crate::mir::builder) fn run_all_pipeline_checks(
join_module: &JoinModule,
boundary: &JoinInlineBoundary,
) -> Result<(), String> {
super::super::merge::contract_checks::run_all_pipeline_checks(join_module, boundary)
}

View File

@ -1,20 +0,0 @@
//! Receiver helpers (SSOT)
//!
//! Motivation: surface syntax uses `this` / `me`, but the MIR builder's `variable_map`
//! registers the receiver under a specific key. Patterns must not guess that key.
use crate::mir::builder::MirBuilder;
use crate::mir::ValueId;
/// Return the host ValueId for `me` receiver (SSOT).
///
/// Patterns should use this instead of hardcoding `"me"` / `"this"`.
pub(in crate::mir::builder) fn get_me_host_id(builder: &MirBuilder, context: &str) -> Result<ValueId, String> {
builder
.variable_ctx
.variable_map
.get("me")
.copied()
.ok_or_else(|| format!("[{}] receiver 'me' not found in variable_map", context))
}