refactor(mir): Phase 25.1n - レガシーコード削除(未使用コード整理)
**削減内容**: - loop_builder.rs: incomplete_phis, emit_safepoint, mark_block_sealed (-28行) - builder.rs: hint_loop_*, debug_loop_*, debug_replace_region (-28行) - builder/loops.rs: create_loop_blocks (-9行) **成果**: - コード削減: 65行の未使用コード削除 - 警告削減: 7個 → 2個 (71%削減) - 機能維持: すべてのテスト通過 ✅ **削除されたレガシーAPI**: - incomplete_phis フィールド (LoopFormBuilder移行後未使用) - emit_safepoint() メソッド (未使用) - mark_block_sealed() メソッド (未使用) - hint_loop_header/latch/carrier() (ヒントシステム未使用) - debug_next_loop_id() (デバッグ機能未使用) - debug_replace_region() (デバッグ機能未使用) - create_loop_blocks() (LoopForm v2移行後未使用) 🧹 箱化・モジュール化の第一歩として未使用コード整理完了 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@ -7,7 +7,6 @@
|
||||
|
||||
use super::{BasicBlockId, ConstValue, MirInstruction, ValueId};
|
||||
use crate::mir::control_form::{ControlForm, IfShape, LoopShape, is_control_form_trace_on};
|
||||
use crate::mir::phi_core::loop_phi::IncompletePhi;
|
||||
use crate::mir::phi_core::loopform_builder::{LoopFormBuilder, LoopFormOps};
|
||||
use crate::ast::ASTNode;
|
||||
use std::collections::HashMap;
|
||||
@ -18,16 +17,11 @@ use super::utils::{
|
||||
capture_actual_predecessor_and_jump,
|
||||
};
|
||||
|
||||
// IncompletePhi has moved to phi_core::loop_phi
|
||||
|
||||
/// ループビルダー - SSA形式でのループ構築を管理
|
||||
pub struct LoopBuilder<'a> {
|
||||
/// 親のMIRビルダーへの参照
|
||||
parent_builder: &'a mut super::builder::MirBuilder,
|
||||
|
||||
/// ループ内で追跡する変数の不完全Phi node
|
||||
incomplete_phis: HashMap<BasicBlockId, Vec<IncompletePhi>>,
|
||||
|
||||
/// ブロックごとの変数マップ(スコープ管理)
|
||||
#[allow(dead_code)]
|
||||
block_var_maps: HashMap<BasicBlockId, HashMap<String, ValueId>>,
|
||||
@ -108,15 +102,12 @@ impl<'a> LoopBuilder<'a> {
|
||||
// =============================================================
|
||||
/// 新しいループビルダーを作成
|
||||
pub fn new(parent: &'a mut super::builder::MirBuilder) -> Self {
|
||||
// フェーズM: no_phi_mode初期化削除
|
||||
Self {
|
||||
parent_builder: parent,
|
||||
incomplete_phis: HashMap::new(),
|
||||
block_var_maps: HashMap::new(),
|
||||
loop_header: None,
|
||||
continue_snapshots: Vec::new(),
|
||||
exit_snapshots: Vec::new(), // exit PHI用のスナップショット
|
||||
// フェーズM: no_phi_modeフィールド削除
|
||||
}
|
||||
}
|
||||
|
||||
@ -441,11 +432,6 @@ impl<'a> LoopBuilder<'a> {
|
||||
})
|
||||
}
|
||||
|
||||
fn emit_safepoint(&mut self) -> Result<(), String> {
|
||||
self.parent_builder
|
||||
.emit_instruction(MirInstruction::Safepoint)
|
||||
}
|
||||
|
||||
fn emit_const(&mut self, dst: ValueId, value: ConstValue) -> Result<(), String> {
|
||||
self.parent_builder
|
||||
.emit_instruction(MirInstruction::Const { dst, value })
|
||||
@ -551,20 +537,6 @@ impl<'a> LoopBuilder<'a> {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
fn mark_block_sealed(&mut self, block_id: BasicBlockId) -> Result<(), String> {
|
||||
if let Some(ref mut function) = self.parent_builder.current_function {
|
||||
if let Some(block) = function.get_block_mut(block_id) {
|
||||
block.seal();
|
||||
Ok(())
|
||||
} else {
|
||||
Err(format!("Block {} not found", block_id))
|
||||
}
|
||||
} else {
|
||||
Err("No current function".to_string())
|
||||
}
|
||||
}
|
||||
|
||||
// =============================================================
|
||||
// Variable Map Utilities — snapshots and rebinding
|
||||
// =============================================================
|
||||
|
||||
Reference in New Issue
Block a user