Review Board 2.0.15


NDEBUG for Ruby Assert statement

Review Request #337 - Created Dec. 2, 2010 and submitted

Information
Nilay Vaish
gem5
Reviewers
Default
This diff is for changing the way ASSERT is handled in Ruby. m5.fast compiles out the assert statements by using the macro NDEBUG. Ruby uses the macro RUBY_NO_ASSERT to do so. This macro has been removed and NDEBUG has been put in its place.
I have compiled the source code with this change. The object files created for debug version have the assert statements while those for the fast version don't.
Review request changed
Updated (Dec. 2, 2010, 12:35 p.m.)

People:

-ali
-gblack
-stever
-nate
Ship it!
Posted (Dec. 2, 2010, 11:15 p.m.)
Looks good to me.
Posted (Dec. 6, 2010, 7:56 a.m.)



  
src/mem/ruby/common/Debug.hh (Diff revision 2)
 
 
Someday we should unify m5 & Ruby assertions... basically everyone should use this macro or no one should.  Don't hold up this patch on that though; I just want to throw that thought out there for consideration.
src/mem/ruby/common/Debug.hh (Diff revision 2)
 
 
What changed in these lines?  I don't see any difference here.  Was it just a whitespace thing?  If so, was it intentional?
  1. I had shifted the entire code that appears under the block if(ASSERT_FLAG). For these lines, '<<' was aligned with '<<' appearing in the line above.
  2. I see... they used to be off by one but now they're not anymore.
src/mem/slicc/ast/FuncCallExprAST.py (Diff revision 2)
 
 
Is there a reason the compiler doesn't just emit "ASSERT(${{cvec[0]}})" here?  That seems more straightforward to me, unless there's a good reason to do it this way.
  1. I think the reason is that we would like to have the line numbers from the .sm file. If we use ASSERT(), then the line numbers from the generated .cc files will be put in place.
  2. That makes sense, thanks...
Ship it!
Posted (Dec. 6, 2010, 8:33 a.m.)