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:
@@ -33,7 +33,7 @@ impl<'a> CFGPrinter<'a> {
|
||||
pub fn new(func: &'a Function) -> CFGPrinter<'a> {
|
||||
CFGPrinter {
|
||||
func: func,
|
||||
cfg: ControlFlowGraph::new(func),
|
||||
cfg: ControlFlowGraph::with_function(func),
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user