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

@ -93,9 +93,10 @@ impl MirVerifier {
instruction_index
);
if let Some(bb) = function.blocks.get(block) {
let inst_opt = bb.all_instructions().nth(*instruction_index);
if let Some(inst) = inst_opt {
eprintln!("[mir-ssa-debug-inst] inst={:?}", inst);
let inst_opt =
bb.all_spanned_instructions_enumerated().nth(*instruction_index);
if let Some((_idx, sp)) = inst_opt {
eprintln!("[mir-ssa-debug-inst] inst={:?}", sp.inst);
}
}
}
@ -291,8 +292,8 @@ impl MirVerifier {
// Collect values used in merge block
let mut used_values = std::collections::HashSet::new();
for inst in merge_bb.all_instructions() {
for v in inst.used_values() {
for sp in merge_bb.all_spanned_instructions() {
for v in sp.inst.used_values() {
used_values.insert(v);
}
}