Change Successors
to impl Iterator<Item = BasicBlock>
This commit is contained in:
parent
56d540e057
commit
38bf1158bd
18 changed files with 54 additions and 55 deletions
|
@ -81,7 +81,7 @@ impl<'a, 'tcx> CfgSimplifier<'a, 'tcx> {
|
|||
|
||||
for (_, data) in traversal::preorder(body) {
|
||||
if let Some(ref term) = data.terminator {
|
||||
for &tgt in term.successors() {
|
||||
for tgt in term.successors() {
|
||||
pred_count[tgt] += 1;
|
||||
}
|
||||
}
|
||||
|
@ -235,8 +235,8 @@ impl<'a, 'tcx> CfgSimplifier<'a, 'tcx> {
|
|||
};
|
||||
|
||||
let first_succ = {
|
||||
if let Some(&first_succ) = terminator.successors().next() {
|
||||
if terminator.successors().all(|s| *s == first_succ) {
|
||||
if let Some(first_succ) = terminator.successors().next() {
|
||||
if terminator.successors().all(|s| s == first_succ) {
|
||||
let count = terminator.successors().count();
|
||||
self.pred_count[first_succ] -= (count - 1) as u32;
|
||||
first_succ
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue