Cargo-fmt fixes
This commit is contained in:
@@ -40,7 +40,6 @@ pub struct ControlFlowGraph {
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl ControlFlowGraph {
|
impl ControlFlowGraph {
|
||||||
|
|
||||||
/// During initialization mappings will be generated for any existing
|
/// During initialization mappings will be generated for any existing
|
||||||
/// blocks within the CFG's associated function. Basic sanity checks will
|
/// blocks within the CFG's associated function. Basic sanity checks will
|
||||||
/// also be performed to ensure that the blocks are well formed.
|
/// also be performed to ensure that the blocks are well formed.
|
||||||
@@ -76,7 +75,7 @@ impl ControlFlowGraph {
|
|||||||
InstructionData::Nullary { ty: _, opcode: _ } => {
|
InstructionData::Nullary { ty: _, opcode: _ } => {
|
||||||
terminated = true;
|
terminated = true;
|
||||||
}
|
}
|
||||||
_ => ()
|
_ => (),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -89,16 +88,19 @@ impl ControlFlowGraph {
|
|||||||
self.data.insert(ebb, BTreeSet::new());
|
self.data.insert(ebb, BTreeSet::new());
|
||||||
match self.data.get_mut(&ebb) {
|
match self.data.get_mut(&ebb) {
|
||||||
Some(predecessors) => Ok(predecessors),
|
Some(predecessors) => Ok(predecessors),
|
||||||
None => Err("Ebb initialization failed.")
|
None => Err("Ebb initialization failed."),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Attempts to add a predecessor for some ebb, attempting to initialize
|
/// Attempts to add a predecessor for some ebb, attempting to initialize
|
||||||
/// any ebb which has no entry.
|
/// any ebb which has no entry.
|
||||||
pub fn add_predecessor(&mut self, ebb: Ebb, predecessor: Predecessor) -> Result<(), &'static str> {
|
pub fn add_predecessor(&mut self,
|
||||||
|
ebb: Ebb,
|
||||||
|
predecessor: Predecessor)
|
||||||
|
-> Result<(), &'static str> {
|
||||||
let success = match self.data.get_mut(&ebb) {
|
let success = match self.data.get_mut(&ebb) {
|
||||||
Some(predecessors) => predecessors.insert(predecessor),
|
Some(predecessors) => predecessors.insert(predecessor),
|
||||||
None => false
|
None => false,
|
||||||
};
|
};
|
||||||
|
|
||||||
if success {
|
if success {
|
||||||
|
|||||||
Reference in New Issue
Block a user