[LLVMdev] Old DOUT
Chris Lattner
clattner at apple.com
Thu Dec 10 15:53:12 PST 2009
On Dec 10, 2009, at 1:46 PM, David Greene wrote:
> 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?
If you're asking if a new dbgs() might be useful, "yes if specified well". If you're asking if you can convert everything to using it, "no".
> 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.
What do you mean?
-Chris
More information about the llvm-dev
mailing list