Normalize passes keep spans and clean warnings

This commit is contained in:
nyash-codex
2025-11-24 15:02:51 +09:00
parent 466e636af6
commit da1a5558e5
40 changed files with 547 additions and 362 deletions

View File

@ -72,7 +72,13 @@ impl MirBuilder {
// 統一された挿入ロジック(既存パターンと完全互換)
if let (Some(func), Some(cur_bb)) = (self.current_function.as_mut(), self.current_block) {
// CFG経由の正規化挿入predecessor順序の正規化を含む
crate::mir::ssot::cf_common::insert_phi_at_head(func, cur_bb, phi_val, inputs);
crate::mir::ssot::cf_common::insert_phi_at_head_spanned(
func,
cur_bb,
phi_val,
inputs,
self.current_span,
);
} else {
// フォールバック: 直接emit主にテストや特殊ケース用
self.emit_instruction(MirInstruction::Phi {
@ -131,7 +137,13 @@ impl MirBuilder {
// 統一された挿入ロジック(既存パターンと完全互換)
if let (Some(func), Some(cur_bb)) = (self.current_function.as_mut(), self.current_block) {
// CFG経由の正規化挿入predecessor順序の正規化を含む
crate::mir::ssot::cf_common::insert_phi_at_head(func, cur_bb, dst, inputs);
crate::mir::ssot::cf_common::insert_phi_at_head_spanned(
func,
cur_bb,
dst,
inputs,
self.current_span,
);
} else {
// フォールバック: 直接emit主にテストや特殊ケース用
self.emit_instruction(MirInstruction::Phi { dst, inputs })?;