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:
Dan Gohman
2017-09-14 14:38:53 -07:00
committed by GitHub
parent 39992014e0
commit bbe056bf9d
15 changed files with 72 additions and 43 deletions

View File

@@ -250,7 +250,6 @@ mod tests {
trans.translate(&BODY, &mut ctx.func, &mut runtime).unwrap();
dbg!("{}", ctx.func.display(None));
ctx.flowgraph();
ctx.verify(None).unwrap();
}
@@ -284,7 +283,6 @@ mod tests {
trans.translate(&BODY, &mut ctx.func, &mut runtime).unwrap();
dbg!("{}", ctx.func.display(None));
ctx.flowgraph();
ctx.verify(None).unwrap();
}
@@ -324,7 +322,6 @@ mod tests {
trans.translate(&BODY, &mut ctx.func, &mut runtime).unwrap();
dbg!("{}", ctx.func.display(None));
ctx.flowgraph();
ctx.verify(None).unwrap();
}
}