Make the ControlFlowGraph reusable.
Move the flow graph computation into a compute method which can be called with multiple functions. This allows us to reuse the ControlFlowGraph memory and keep an instance in the Context.
This commit is contained in:
@@ -8,7 +8,7 @@ use self::cretonne::entity_map::EntityMap;
|
||||
|
||||
fn test_reverse_postorder_traversal(function_source: &str, ebb_order: Vec<u32>) {
|
||||
let func = &parse_functions(function_source).unwrap()[0];
|
||||
let cfg = ControlFlowGraph::new(&func);
|
||||
let cfg = ControlFlowGraph::with_function(&func);
|
||||
let ebbs = ebb_order.iter()
|
||||
.map(|n| Ebb::with_number(*n).unwrap())
|
||||
.collect::<Vec<Ebb>>();
|
||||
|
||||
Reference in New Issue
Block a user