Add a Function::clear() method.
This makes it possible to clear out a Function data structure so it can be reused for compiling multiple functions. Also add clear() methods to various sub-structures.
This commit is contained in:
@@ -74,6 +74,17 @@ impl DataFlowGraph {
|
||||
}
|
||||
}
|
||||
|
||||
/// Clear everything.
|
||||
pub fn clear(&mut self) {
|
||||
self.insts.clear();
|
||||
self.results.clear();
|
||||
self.ebbs.clear();
|
||||
self.value_lists.clear();
|
||||
self.values.clear();
|
||||
self.signatures.clear();
|
||||
self.ext_funcs.clear();
|
||||
}
|
||||
|
||||
/// Get the total number of instructions created in this function, whether they are currently
|
||||
/// inserted in the layout or not.
|
||||
///
|
||||
|
||||
Reference in New Issue
Block a user