Normalize passes keep spans and clean warnings
This commit is contained in:
@ -134,17 +134,14 @@ impl LoopBuilderApi for super::builder::MirBuilder {
|
||||
inputs: Vec<(BasicBlockId, ValueId)>,
|
||||
) -> Result<(), String> {
|
||||
if let Some(ref mut f) = self.current_function {
|
||||
if let Some(bb) = f.get_block_mut(block) {
|
||||
let inst = MirInstruction::Phi { dst, inputs };
|
||||
// Update effect mask and insert at the very start
|
||||
bb.effects = bb.effects | inst.effects();
|
||||
bb.instructions.insert(0, inst);
|
||||
bb.instruction_spans
|
||||
.insert(0, self.current_span);
|
||||
Ok(())
|
||||
} else {
|
||||
Err(format!("Block {} not found", block.as_u32()))
|
||||
}
|
||||
crate::mir::ssot::cf_common::insert_phi_at_head_spanned(
|
||||
f,
|
||||
block,
|
||||
dst,
|
||||
inputs,
|
||||
self.current_span,
|
||||
);
|
||||
Ok(())
|
||||
} else {
|
||||
Err("No current function".into())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user