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:
@@ -916,8 +916,8 @@ impl<'a> Verifier<'a> {
|
||||
let mut got_preds = BTreeSet::<Inst>::new();
|
||||
|
||||
for ebb in self.func.layout.ebbs() {
|
||||
expected_succs.extend(self.expected_cfg.get_successors(ebb));
|
||||
got_succs.extend(cfg.get_successors(ebb));
|
||||
expected_succs.extend(self.expected_cfg.succ_iter(ebb));
|
||||
got_succs.extend(cfg.succ_iter(ebb));
|
||||
|
||||
let missing_succs: Vec<Ebb> = expected_succs.difference(&got_succs).cloned().collect();
|
||||
if !missing_succs.is_empty() {
|
||||
|
||||
Reference in New Issue
Block a user