Review Board 2.0.15


misc: Add panic_if / fatal_if / chatty_assert

Review Request #2164 - Created Feb. 21, 2014 and submitted - Latest diff uploaded

Information
Andreas Hansson
gem5
default
Reviewers
Default
Changeset 10104:4d3c10cadce3
---------------------------
misc: Add panic_if / fatal_if / chatty_assert

This snippet can be used to replace if + {panics, fatals, asserts} constructs.
The idea is to have both the condition checking and a verbose printout in a single statement.  The interface is as follows:

panic_if(foo != bar, "These should be equal: foo %i bar %i", foo, bar);
fatal_if(foo != bar, "These should be equal: foo %i bar %i", foo, bar);
chatty_assert(foo == bar, "These should be equal: foo %i bar %i", foo, bar);
All regressions pass (as it does not affect existing code).