Refactor matches that used to consume BranchInfo (#5734)
Explicitly borrow the instruction data, and use a mutable borrow to avoid rematch.
This commit is contained in:
@@ -117,7 +117,7 @@ impl ControlFlowGraph {
|
||||
|
||||
fn compute_block(&mut self, func: &Function, block: Block) {
|
||||
if let Some(inst) = func.layout.last_inst(block) {
|
||||
match func.dfg.insts[inst] {
|
||||
match &func.dfg.insts[inst] {
|
||||
ir::InstructionData::Jump {
|
||||
destination: dest, ..
|
||||
} => {
|
||||
@@ -135,9 +135,9 @@ impl ControlFlowGraph {
|
||||
destination: dest,
|
||||
..
|
||||
} => {
|
||||
self.add_edge(block, inst, dest);
|
||||
self.add_edge(block, inst, *dest);
|
||||
|
||||
for dest in func.jump_tables[jt].iter() {
|
||||
for dest in func.jump_tables[*jt].iter() {
|
||||
self.add_edge(block, inst, *dest);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user