[LLVMdev] Old DOUT
David Greene
dag at cray.com
Thu Dec 10 13:46:03 PST 2009
On Thursday 10 December 2009 16:30, Anton Korobeynikov wrote:
> Hello, David
>
> > What replaced the old DOUT?
>
> DEBUG(errs() << foo);
>
> The reason is quite simple - DOUT in release mode was just /dev/null,
> but the functions sending data to it were still called.
errs() is no good. I would want to keep errs() printing things out
immediately. I need something else that buffers until program termination.
So I would write the above as:
DEBUG(dbgs() << foo);
Does that sound reasonable?
There are some tricky cases where dump routines are used either to
print error messages or to print debug information. In those cases
I may have to parameterize the dump routine with the stream.
-Dave
More information about the llvm-dev
mailing list