Normalize passes keep spans and clean warnings
This commit is contained in:
@ -119,7 +119,13 @@ impl super::MirBuilder {
|
||||
self.start_new_block(merge_block)?;
|
||||
// フェーズM: PHI はブロック先頭に配置(cf_common 統一)
|
||||
if let (Some(func), Some(cur_bb)) = (self.current_function.as_mut(), self.current_block) {
|
||||
crate::mir::ssot::cf_common::insert_phi_at_head(func, cur_bb, result_val, phi_inputs);
|
||||
crate::mir::ssot::cf_common::insert_phi_at_head_spanned(
|
||||
func,
|
||||
cur_bb,
|
||||
result_val,
|
||||
phi_inputs,
|
||||
self.current_span,
|
||||
);
|
||||
} else {
|
||||
self.emit_instruction(super::MirInstruction::Phi {
|
||||
dst: result_val,
|
||||
|
||||
@ -83,8 +83,12 @@ impl MirBuilder {
|
||||
if let (Some(func), Some(cur_bb)) =
|
||||
(self.current_function.as_mut(), self.current_block)
|
||||
{
|
||||
crate::mir::ssot::cf_common::insert_phi_at_head(
|
||||
func, cur_bb, merged, inputs,
|
||||
crate::mir::ssot::cf_common::insert_phi_at_head_spanned(
|
||||
func,
|
||||
cur_bb,
|
||||
merged,
|
||||
inputs,
|
||||
self.current_span,
|
||||
);
|
||||
} else {
|
||||
self.emit_instruction(MirInstruction::Phi {
|
||||
|
||||
@ -7,7 +7,6 @@
|
||||
//! Box-First理論: PHI insertion の境界を明確にし、差し替え可能な箱として提供
|
||||
|
||||
use super::{BasicBlockId, MirBuilder, ValueId};
|
||||
use crate::mir::MirInstruction;
|
||||
use std::collections::BTreeMap; // Phase 25.1: 決定性確保
|
||||
|
||||
/// PHI Merge Helper - 統一PHI挿入ロジック(Conservative戦略)
|
||||
|
||||
@ -213,6 +213,8 @@ impl super::MirBuilder {
|
||||
/// - While/ForRange は将来 Loop lowering へ委譲する拡張ポイントとして扱い、
|
||||
/// 現状は他の専用ビルダ/既存パスと同様に build_expression に委譲する。
|
||||
pub(super) fn build_statement(&mut self, node: ASTNode) -> Result<ValueId, String> {
|
||||
// Align current_span to this statement node before lowering expressions under it.
|
||||
self.current_span = node.span();
|
||||
match node {
|
||||
// 将来ここに While / ForRange / Match / Using など statement 専用分岐を追加する。
|
||||
other => self.build_expression(other),
|
||||
|
||||
Reference in New Issue
Block a user