Add a 'clear()' function to Context.

This includes adding `clear()` functions to its (transitive) members.
This commit is contained in:
Dan Gohman
2017-11-15 10:49:32 -08:00
parent 4c829f7c7f
commit 4d9aedbaca
10 changed files with 85 additions and 2 deletions

View File

@@ -515,6 +515,17 @@ impl Solver {
}
}
/// Clear all data structures in this coloring pass.
pub fn clear(&mut self) {
self.assignments.clear();
self.vars.clear();
self.inputs_done = false;
self.regs_in = AllocatableSet::new();
self.regs_out = AllocatableSet::new();
self.moves.clear();
self.fills.clear();
}
/// Reset the solver state and prepare solving for a new instruction with an initial set of
/// allocatable registers.
///