[LLVMdev] [PATCH] Implement dbgs()

Török Edwin edwintorok at gmail.com
Mon Dec 21 08:14:56 PST 2009


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.

Isn't there a better macro to differentiate between Release and Debug
builds?

Or to allow the library's client to specify whether it wants the signal
handler or not?
That would be similar to how the PrettyStacktrace stuff works: client
software can skip it completely when in release mode,
and still have assertions enabled.

Best regards,
--Edwin



More information about the llvm-dev mailing list