diff --git a/src/mir/loop_builder.rs b/src/mir/loop_builder.rs index 50993817..c3a62f35 100644 --- a/src/mir/loop_builder.rs +++ b/src/mir/loop_builder.rs @@ -468,39 +468,8 @@ impl<'a> LoopBuilder<'a> { } /// ブロックをシールし、不完全なPhi nodeを完成させる - fn seal_block(&mut self, block_id: BasicBlockId, latch_id: BasicBlockId) -> Result<(), String> { - if let Some(incomplete_phis) = self.incomplete_phis.remove(&block_id) { - let cont_snaps = self.continue_snapshots.clone(); - crate::mir::phi_core::loop_phi::seal_incomplete_phis_with( - self, - block_id, - latch_id, - incomplete_phis, - &cont_snaps, - )?; - } - self.mark_block_sealed(block_id)?; - Ok(()) - } /// Exitブロックで変数のPHIを生成(breakポイントでの値を統一) - fn create_exit_phis(&mut self, header_id: BasicBlockId, exit_id: BasicBlockId) -> Result<(), String> { - // Use the saved header block snapshot instead of current variable map - // The current block at this point is the exit block, not the header, - // so we must retrieve the header's snapshot from block_var_maps. - let header_vars = self.block_var_maps - .get(&header_id) - .cloned() - .unwrap_or_else(|| self.get_current_variable_map()); - let exit_snaps = self.exit_snapshots.clone(); - crate::mir::phi_core::loop_phi::build_exit_phis_with( - self, - header_id, - exit_id, - &header_vars, - &exit_snaps, - ) - } // --- ヘルパーメソッド(親ビルダーへの委譲) --- @@ -655,11 +624,6 @@ impl<'a> LoopBuilder<'a> { } } - fn mark_block_unsealed(&mut self, _block_id: BasicBlockId) -> Result<(), String> { - // ブロックはデフォルトでunsealedなので、特に何もしない - // (既にBasicBlock::newでsealed: falseに初期化されている) - Ok(()) - } fn mark_block_sealed(&mut self, block_id: BasicBlockId) -> Result<(), String> { if let Some(ref mut function) = self.parent_builder.current_function { @@ -702,10 +666,6 @@ impl<'a> LoopBuilder<'a> { self.parent_builder.variable_map.get(name).copied() } - fn build_expression_with_phis(&mut self, expr: ASTNode) -> Result { - // Phi nodeの結果を考慮しながら式を構築 - self.parent_builder.build_expression(expr) - } fn build_statement(&mut self, stmt: ASTNode) -> Result { match stmt {