[LLVMdev] [PATCH] dbgs() Use

Chris Lattner clattner at apple.com
Fri Dec 18 17:50:14 PST 2009


On Dec 17, 2009, at 4:08 PM, David Greene wrote:

> Here's an example patch of how dbgs() will be used.  Essentially I  
> will
> replace uses of errs() with dbgs().  I believe this is the correct  
> thing
> to do because:
>
> - With #define NDEBUG, dbgs() == errs()
>
> - With debugging and -debug-buffer-size=0 (the default), dbgs() just
>  passes output to errs().
>
> - When -debug-buffer-size>0, you want to buffer ALL output so that you
>  don't get some strange reordering effect where some output goes out
>  early and the rest gets dumped at the end.
>
> Please review and let me know if the general approach is ok.  I will
> start to convert files once I get the ok.

Sounds good.

> +++ lib/CodeGen/SelectionDAG/SelectionDAG.cpp	(working copy)
> +++ lib/Target/X86/X86ISelDAGToDAG.cpp	(working copy)

Looks fine to me, go ahead and convert stuff over when the  
dependencies go in.  Please make sure not to change things that  
*really should* go errs(), such as stuff in top level tools that want  
to print errors.

-Chris




More information about the llvm-dev mailing list