Have FunctionBuilder clear the ILBuilder's state in its drop().

This commit is contained in:
Dan Gohman
2017-10-19 15:13:59 -07:00
parent 9fdf44afd4
commit f4b25ff058
2 changed files with 25 additions and 5 deletions

View File

@@ -168,6 +168,13 @@ where
debug_assert!(self.results.is_empty());
debug_assert!(self.side_effects.is_empty());
}
/// Tests whether an `SSABuilder` is in a cleared state.
pub fn is_empty(&self) -> bool {
self.variables.is_empty() && self.blocks.is_empty() && self.ebb_headers.is_empty() &&
self.calls.is_empty() &&
self.results.is_empty() && self.side_effects.is_empty()
}
}
// Small enum used for clarity in some functions.