chore(joinir): Phase 286C-5 Step 3 - Remove unused imports
Ran `cargo fix --allow-dirty --lib` to automatically remove unused imports across the codebase. This cleanup is standard maintenance and improves code hygiene. **Files Modified**: - instruction_rewriter.rs: Removed 6 unused imports - block_remapper::remap_block_id - LoweringDecision - ParameterBindingBox - propagate_value_type_for_inst (2 occurrences) - apply_remapped_terminator - PhiAdjustment, ParameterBinding from scan_box - Other files: Minor unused import cleanup (12 files total) **No Functional Changes**: Pure cleanup, all tests expected to pass. Phase 286C-5 progress: 3/4 steps complete Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@ -49,12 +49,12 @@
|
||||
//! - **Main function**: `merge_and_rewrite` (lines 63-1400)
|
||||
//! - **Target**: Reduce to ~600 lines by extracting 4 boxes (InstructionFilterBox, ReturnConverterBox, TailCallDetectorBox, ParameterBindingBox)
|
||||
|
||||
use super::block_remapper::remap_block_id; // Phase 284 P1: SSOT
|
||||
// Phase 284 P1: SSOT
|
||||
use super::exit_args_collector::ExitArgsCollectorBox;
|
||||
use super::loop_header_phi_info::LoopHeaderPhiInfo;
|
||||
use super::merge_result::MergeResult;
|
||||
use super::tail_call_classifier::{classify_tail_call, TailCallKind};
|
||||
use super::tail_call_lowering_policy::{LoweringDecision, TailCallLoweringPolicyBox};
|
||||
use super::tail_call_lowering_policy::TailCallLoweringPolicyBox;
|
||||
use super::super::trace;
|
||||
use crate::mir::builder::joinir_id_remapper::JoinIrIdRemapper;
|
||||
use crate::mir::join_ir::lowering::error_tags;
|
||||
@ -69,15 +69,13 @@ use super::rewriter::helpers::is_skippable_continuation;
|
||||
// Phase 286C-2 Step 2: Import from instruction_filter_box module
|
||||
use super::rewriter::instruction_filter_box::InstructionFilterBox;
|
||||
// Phase 286C-2 Step 2: Import from parameter_binding_box module
|
||||
use super::rewriter::parameter_binding_box::ParameterBindingBox;
|
||||
// Phase 286C-2 Step 2: Import from return_converter_box module
|
||||
use super::rewriter::return_converter_box::ReturnConverterBox;
|
||||
// Phase 286C-3: Import RewriteContext for state consolidation
|
||||
use super::rewriter::rewrite_context::RewriteContext;
|
||||
// Phase 260 P0.1 Step 4: Import from type_propagation module
|
||||
use super::rewriter::type_propagation::propagate_value_type_for_inst;
|
||||
// Phase 260 P0.1 Step 5: Import from terminator module
|
||||
use super::rewriter::terminator::{apply_remapped_terminator, remap_branch, remap_jump};
|
||||
use super::rewriter::terminator::{remap_branch, remap_jump};
|
||||
// Phase 260 P0.1 Step 6: exit_collection module available
|
||||
// TODO: Migrate inline Return→Jump conversion to use exit_collection functions:
|
||||
// - collect_exit_values_from_edge_args()
|
||||
@ -88,7 +86,7 @@ use super::rewriter::terminator::{apply_remapped_terminator, remap_branch, remap
|
||||
// requires careful refactoring due to logging context and flow control.
|
||||
|
||||
// Phase 286C-2.1: Import scaffolding data structures for 3-stage pipeline
|
||||
use super::rewriter::scan_box::{RewritePlan, TailCallRewrite, ReturnConversion, PhiAdjustment, ParameterBinding};
|
||||
use super::rewriter::scan_box::{RewritePlan, TailCallRewrite, ReturnConversion};
|
||||
use super::rewriter::plan_box::RewrittenBlocks;
|
||||
// Phase 286C-5 Step 1: Import CarrierInputsCollector for DRY
|
||||
use super::rewriter::carrier_inputs_collector::CarrierInputsCollector;
|
||||
@ -236,7 +234,7 @@ fn plan_rewrites(
|
||||
debug: bool,
|
||||
) -> Result<RewrittenBlocks, String> {
|
||||
use super::rewriter::plan_helpers::{build_local_block_map, sync_spans};
|
||||
use super::rewriter::type_propagation::propagate_value_type_for_inst;
|
||||
|
||||
use super::phi_block_remapper::remap_phi_instruction;
|
||||
use super::block_remapper::remap_block_id;
|
||||
|
||||
|
||||
@ -4,7 +4,6 @@
|
||||
//! Adds/replaces blocks in MirBuilder WITHOUT reading/analyzing.
|
||||
|
||||
use crate::mir::builder::MirBuilder;
|
||||
use crate::mir::{BasicBlock, BasicBlockId};
|
||||
|
||||
use super::plan_box::RewrittenBlocks;
|
||||
|
||||
|
||||
@ -4,7 +4,7 @@
|
||||
//! These are pure helper functions that both the current monolithic code and the
|
||||
//! new plan_rewrites() function can use.
|
||||
|
||||
use crate::mir::{BasicBlock, BasicBlockId, MirFunction, MirInstruction, ValueId};
|
||||
use crate::mir::{BasicBlock, BasicBlockId, MirFunction, MirInstruction};
|
||||
use crate::mir::builder::joinir_id_remapper::JoinIrIdRemapper;
|
||||
use std::collections::BTreeMap;
|
||||
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
//! Phase 286C-2.1: First stage of 3-stage pipeline (Scan → Plan → Apply)
|
||||
//! Identifies what needs to be rewritten WITHOUT mutating any state.
|
||||
|
||||
use crate::mir::{BasicBlock, BasicBlockId, MirFunction, MirInstruction, ValueId};
|
||||
use crate::mir::{BasicBlock, BasicBlockId, MirInstruction, ValueId};
|
||||
use std::collections::BTreeSet;
|
||||
|
||||
/// Rewrite plan: Describes WHAT to do (doesn't touch instructions yet)
|
||||
@ -108,7 +108,7 @@ impl ScanBox {
|
||||
block_id: BasicBlockId,
|
||||
_func_name: &str,
|
||||
) -> BlockScanResult {
|
||||
let mut skip_instructions = BTreeSet::new();
|
||||
let skip_instructions = BTreeSet::new();
|
||||
let mut found_tail_call = false;
|
||||
|
||||
// Scan instructions for tail calls, returns, etc.
|
||||
|
||||
@ -3,7 +3,6 @@
|
||||
//! Phase 286C-2: Extracted from instruction_rewriter.rs
|
||||
//! Helper functions related to tail call detection and classification.
|
||||
|
||||
use crate::mir::ValueId;
|
||||
|
||||
/// TailCallDetectorBox: Tail call detection helpers
|
||||
///
|
||||
|
||||
@ -27,9 +27,7 @@
|
||||
//! - Side effects: result.push() in both loop and post-loop
|
||||
//! - P0 restriction: 1-char separator only
|
||||
|
||||
use super::super::trace;
|
||||
use crate::ast::ASTNode;
|
||||
use crate::mir::builder::MirBuilder;
|
||||
|
||||
/// Phase 256 P0: Split/Scan pattern parts extractor
|
||||
///
|
||||
|
||||
@ -3,11 +3,11 @@
|
||||
//! テスト専用の極小サブセット。Pattern1 の while だけを Structured → Normalized に
|
||||
//! 変換して遊ぶための足場だよ。本線の Structured→MIR 経路には影響しない。
|
||||
|
||||
use std::collections::{BTreeMap, HashSet};
|
||||
use std::collections::BTreeMap;
|
||||
|
||||
use crate::mir::join_ir::{
|
||||
BinOpKind, CompareOp, ConstValue, JoinContId, JoinFuncId, JoinFunction, JoinInst, JoinIrPhase,
|
||||
JoinModule, MirLikeInst, UnaryOp,
|
||||
BinOpKind, CompareOp, ConstValue, JoinIrPhase,
|
||||
JoinModule, UnaryOp,
|
||||
};
|
||||
use crate::mir::ValueId;
|
||||
#[cfg(feature = "normalized_dev")]
|
||||
|
||||
@ -7,7 +7,6 @@
|
||||
//! - Create default env layouts
|
||||
//! - Manage env field construction
|
||||
|
||||
use crate::mir::ValueId;
|
||||
use crate::mir::join_ir::JoinFunction;
|
||||
|
||||
use super::{EnvField, EnvLayout};
|
||||
|
||||
@ -11,8 +11,8 @@
|
||||
use std::collections::{BTreeMap, HashSet};
|
||||
|
||||
use crate::mir::join_ir::{
|
||||
BinOpKind, CompareOp, ConstValue, JoinContId, JoinFuncId, JoinFunction, JoinInst, JoinIrPhase,
|
||||
JoinModule, MirLikeInst, UnaryOp,
|
||||
JoinContId, JoinFuncId, JoinFunction, JoinInst, JoinIrPhase,
|
||||
JoinModule, MirLikeInst,
|
||||
};
|
||||
use crate::mir::ValueId;
|
||||
|
||||
|
||||
@ -8,11 +8,11 @@
|
||||
//! - Convert Normalized JoinIR → Structured JoinIR (reverse)
|
||||
//! - Verify normalized module invariants
|
||||
|
||||
use std::collections::{BTreeMap, HashMap};
|
||||
use std::collections::BTreeMap;
|
||||
|
||||
use crate::mir::join_ir::{
|
||||
BinOpKind, CompareOp, ConstValue, JoinContId, JoinFuncId, JoinFunction, JoinInst, JoinIrPhase,
|
||||
JoinModule, MirLikeInst, UnaryOp,
|
||||
JoinContId, JoinFuncId, JoinFunction, JoinInst, JoinIrPhase,
|
||||
JoinModule, MirLikeInst,
|
||||
};
|
||||
use crate::mir::ValueId;
|
||||
|
||||
|
||||
@ -3,7 +3,6 @@
|
||||
*/
|
||||
|
||||
use crate::ast::{ASTNode, Span};
|
||||
use crate::must_advance;
|
||||
use crate::parser::common::ParserUtils;
|
||||
use crate::parser::{NyashParser, ParseError};
|
||||
use crate::tokenizer::TokenType;
|
||||
|
||||
@ -4,7 +4,6 @@
|
||||
*/
|
||||
|
||||
use crate::ast::{ASTNode, Span};
|
||||
use crate::must_advance;
|
||||
use crate::parser::common::ParserUtils;
|
||||
use crate::parser::{NyashParser, ParseError};
|
||||
use crate::tokenizer::TokenType;
|
||||
|
||||
@ -14,8 +14,7 @@
|
||||
use once_cell::sync::OnceCell;
|
||||
use std::collections::HashMap;
|
||||
use std::sync::{
|
||||
atomic::{AtomicU64, Ordering},
|
||||
Arc, RwLock, Weak,
|
||||
atomic::{AtomicU64, Ordering}, RwLock, Weak,
|
||||
};
|
||||
|
||||
use crate::box_trait::NyashBox;
|
||||
|
||||
Reference in New Issue
Block a user