Use a bforest::Set to represent CFG successor sets.
This has two advantages over the previous Vec<Ebb>: - Duplicates are removed. - Clearing the control flow graph is constant time. The set of EBB successors is simply ordered by EBB number.
This commit is contained in:
@@ -184,9 +184,9 @@ fn postorder_ebbs_loop(loop_analysis: &LoopAnalysis, cfg: &ControlFlowGraph, lp:
|
||||
grey.insert(node);
|
||||
stack.push(node);
|
||||
// Get any children we've never seen before.
|
||||
for child in cfg.get_successors(node) {
|
||||
if loop_analysis.is_in_loop(*child, lp) && !grey.contains(child) {
|
||||
stack.push(*child);
|
||||
for child in cfg.succ_iter(node) {
|
||||
if loop_analysis.is_in_loop(child, lp) && !grey.contains(&child) {
|
||||
stack.push(child);
|
||||
}
|
||||
}
|
||||
} else if !black.contains(&node) {
|
||||
|
||||
Reference in New Issue
Block a user