<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On Jan 10, 2011, at 9:29 AMPST, Duncan Sands wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div>Hi Li Qingan,<br><br><blockquote type="cite">Thanks for your last reply.<br></blockquote><blockquote type="cite">I have made a critical mistake when I stated my question in last email.<br></blockquote><blockquote type="cite">I built llvm in debug mode, but the NDEBUG seemed to be still defined, such that<br></blockquote><blockquote type="cite">the -debug option is not enabled.<br></blockquote><blockquote type="cite">I have restated my configuration below.<br></blockquote><br>you need to configure with --enable-assertions<br>In spite of the name, NDEBUG is not related to optimization or debugging<br>symbols, it means that checking (aka assertions) are disabled.  Probably<br>it should be renamed to NASSERT<br></div></blockquote><div><br></div><div>Use of the name NDEBUG to control assertions comes from the C++ (and C) standards.  I agree this was not a great choice but deviating from the standard would be more confusing than helpful IMO.</div><br><blockquote type="cite"><div>Ciao, Duncan.<br><br><blockquote type="cite">Looking forwards to your reply.<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">Hi Li Qingan,<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><blockquote type="cite"> I have built and installed llvm-2.8 in debug mode using:<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">SRC_DIR/configure --prefix=INS_DIR --enable-debug-runtime --disable-optimized<br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"> --enable-debug-symbols<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">make install<br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"> It seems theNDEBUGcontrols a lot of print-out of debug information, by using<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"> DEBUG() or dbgs().<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"> And it is said thatNDEBUGis in enabled in debug mode, but I find it does not<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"> work and the -debug option is not recognized. How should I enableNDEBUGor<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"> enable DEBUG() and dbgs()? Should I defineNDEBUGin the .cpp files related,<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"> when I need the debug information?<br></blockquote></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">actually it is the opposite:NDEBUGis enabled when not in debug mode.  The "N" in<br></blockquote><blockquote type="cite">NDEBUGstands for "Not".<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">Ciao, Duncan.<br></blockquote><blockquote type="cite">--<br></blockquote><blockquote type="cite">Best regards,<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">Li Qingan<br></blockquote><blockquote type="cite"><br></blockquote><br>_______________________________________________<br>LLVM Developers mailing list<br><a href="mailto:LLVMdev@cs.uiuc.edu">LLVMdev@cs.uiuc.edu</a>         <a href="http://llvm.cs.uiuc.edu">http://llvm.cs.uiuc.edu</a><br><a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a><br></div></blockquote></div><br></body></html>