Return slices instead of &Vec references.

We Don't need to expose the internal control flow graph representation.
This commit is contained in:
Jakob Stoklund Olesen
2017-02-17 12:05:27 -08:00
parent 1992890f85
commit f3fa0fb4e9

View File

@@ -83,12 +83,12 @@ impl ControlFlowGraph {
}
/// Get the CFG predecessor basic blocks to `ebb`.
pub fn get_predecessors(&self, ebb: Ebb) -> &Vec<BasicBlock> {
pub fn get_predecessors(&self, ebb: Ebb) -> &[BasicBlock] {
&self.data[ebb].predecessors
}
/// Get the CFG successors to `ebb`.
pub fn get_successors(&self, ebb: Ebb) -> &Vec<Ebb> {
pub fn get_successors(&self, ebb: Ebb) -> &[Ebb] {
&self.data[ebb].successors
}