vicis_core/traits/
basic_block.rs

1use id_arena::Id;
2use rustc_hash::FxHashSet;
3use std::fmt;
4
5pub trait BasicBlock: Sized + fmt::Debug {
6    fn preds(&self) -> &FxHashSet<Id<Self>>;
7    fn succs(&self) -> &FxHashSet<Id<Self>>;
8}
9
10pub trait BasicBlockData<BB: BasicBlock> {
11    fn get(&self, id: Id<BB>) -> &BB;
12}
13
14pub trait BasicBlockLayout<BB: BasicBlock> {
15    fn order(&self) -> Box<dyn Iterator<Item = Id<BB>> + '_>;
16}