Add a liveness analysis.

This code is best tested with larger functions with more EBBs.
Perhaps a new file-test category is in order?
This commit is contained in:
Jakob Stoklund Olesen
2017-01-13 11:42:26 -08:00
parent 05e06cb876
commit aec53ec3a9
4 changed files with 304 additions and 4 deletions

View File

@@ -81,6 +81,11 @@ impl<K, V> SparseMap<K, V>
self.dense.is_empty()
}
/// Remove all elements from the mapping.
pub fn clear(&mut self) {
self.dense.clear();
}
/// Returns a reference to the value corresponding to the key.
pub fn get(&self, key: K) -> Option<&V> {
if let Some(idx) = self.sparse.get(key).cloned() {