Replace assert! with debug_assert! in production code paths.

This allows the assertions to be disabled in release builds, so that
the code is faster and smaller, at the expense of not performing the
checks. Assertions can be re-enabled in release builds with the
debug-assertions flag in Cargo.toml, as the top-level Cargo.toml
file does.
This commit is contained in:
Dan Gohman
2018-03-12 10:28:35 -07:00
parent e81a27fb5d
commit 30f8daa9d6
43 changed files with 165 additions and 164 deletions

View File

@@ -242,7 +242,7 @@ impl<'a> Context<'a> {
debug_assert_eq!(self.cur.current_ebb(), Some(ebb));
// We may need to resolve register constraints if there are any noteworthy uses.
assert!(self.reg_uses.is_empty());
debug_assert!(self.reg_uses.is_empty());
self.collect_reg_uses(inst, ebb, constraints);
// Calls usually have fixed register uses.