Make passes assert their dependencies consistently. (#156)
* Make passes assert their dependencies consistently. This avoids ambiguity about whose responsibility it is to run to compute cfg, domtree, and loop_analysis data. * Reset the `valid` flag in DominatorTree's `clear()`. * Remove the redundant assert from DominatorTree::with_function. * Remove the message strings from obvious asserts. This avoids having them spill out into multiple lines. * Refactor calls to `compute` on `Context` objects into helper functions.
This commit is contained in:
@@ -134,7 +134,9 @@ pub fn verify_context(
|
||||
isa: Option<&TargetIsa>,
|
||||
) -> Result {
|
||||
let verifier = Verifier::new(func, isa);
|
||||
verifier.cfg_integrity(cfg)?;
|
||||
if cfg.is_valid() {
|
||||
verifier.cfg_integrity(cfg)?;
|
||||
}
|
||||
if domtree.is_valid() {
|
||||
verifier.domtree_integrity(domtree)?;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user