Fixed trivially_copy_pass_by_ref warnings

This commit is contained in:
Aaron Power
2018-07-25 16:12:39 +01:00
committed by Dan Gohman
parent 299898d494
commit 952a086f32
4 changed files with 20 additions and 20 deletions

View File

@@ -123,11 +123,11 @@ impl ControlFlowGraph {
for inst in func.layout.ebb_insts(ebb) {
match func.dfg.analyze_branch(inst) {
BranchInfo::SingleDest(dest, _) => {
self.add_edge(BasicBlock::new(ebb, inst), dest);
self.add_edge(ebb, inst, dest);
}
BranchInfo::Table(jt) => {
for (_, dest) in func.jump_tables[jt].entries() {
self.add_edge(BasicBlock::new(ebb, inst), dest);
self.add_edge(ebb, inst, dest);
}
}
BranchInfo::NotABranch => {}
@@ -160,13 +160,13 @@ impl ControlFlowGraph {
self.compute_ebb(func, ebb);
}
fn add_edge(&mut self, from: BasicBlock, to: Ebb) {
self.data[from.ebb]
fn add_edge(&mut self, from: Ebb, from_inst: Inst, to: Ebb) {
self.data[from]
.successors
.insert(to, &mut self.succ_forest, &());
self.data[to]
.predecessors
.insert(from.inst, from.ebb, &mut self.pred_forest, &());
.insert(from_inst, from, &mut self.pred_forest, &());
}
/// Get an iterator over the CFG predecessors to `ebb`.