[LLVMdev] [PATCH] Implement dbgs()
Chris Lattner
clattner at apple.com
Mon Dec 21 11:59:05 PST 2009
On Dec 21, 2009, at 8:42 AM, David Greene wrote:
> On Monday 21 December 2009 10:14, Török Edwin wrote:
>> On 2009-12-21 18:06, David Greene wrote:
>>> On Saturday 19 December 2009 00:16, Chris Lattner wrote:
>>>>> Or I think I can just assume (Yikes!) that if the signal handler is
>>>>> invoked it will really be a circular_raw_ostream since the handler
>>>>> should (!) only be set up in debug mode.
>>>>>
>>>>> That scares me a bit, though.
>>>>
>>>> Why don't you just check #ifndef NDEBUG like the code that sets it up?
>>>
>>> Next iteration.
>>
>> Will this setup a signal handler in a Release+Asserts build?
>> That is not very nice, a library shouldn't setup signal handlers, except
>> in debug mode.
>
> Here's a revision. It only adds the handler if DisableDebugBuffering is
> false, DebugFlag is true and the debug buffer size is non-zero.
Please reverse the sense of this, forcing clients to opt into dbgs() buffering, and update the tools to set the flag. Looks good otherwise,
-Chris
More information about the llvm-dev
mailing list