Normalize passes keep spans and clean warnings
This commit is contained in:
@ -17,8 +17,8 @@ pub fn compute_def_blocks(function: &MirFunction) -> HashMap<ValueId, BasicBlock
|
||||
def_block.insert(*pid, function.entry_block);
|
||||
}
|
||||
for (bid, block) in &function.blocks {
|
||||
for inst in block.all_instructions() {
|
||||
if let Some(dst) = inst.dst_value() {
|
||||
for sp in block.all_spanned_instructions() {
|
||||
if let Some(dst) = sp.inst.dst_value() {
|
||||
def_block.insert(dst, *bid);
|
||||
}
|
||||
}
|
||||
@ -79,8 +79,8 @@ pub fn compute_reachable_blocks(function: &MirFunction) -> HashSet<BasicBlockId>
|
||||
worklist.push(*successor);
|
||||
}
|
||||
}
|
||||
for instruction in &block.instructions {
|
||||
if let crate::mir::MirInstruction::Catch { handler_bb, .. } = instruction {
|
||||
for sp in block.iter_spanned() {
|
||||
if let crate::mir::MirInstruction::Catch { handler_bb, .. } = sp.inst {
|
||||
if !reachable.contains(handler_bb) {
|
||||
worklist.push(*handler_bb);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user