On Tuesday 04 August 2009 17:52, Chris Lattner wrote:> I'd prefer for it to be eliminated, but it is currently used widely. > If your patches don't make it substantially worse, I won't have a > problem with them. Bonus points for removing DOUTs though :)Ok, this is good to know. With some of these patches I will have opportunities to remove DOUTS. What's the rationale for getting rid of it? -Dave
On Aug 4, 2009, at 4:03 PM, David Greene wrote:> On Tuesday 04 August 2009 17:52, Chris Lattner wrote: > >> I'd prefer for it to be eliminated, but it is currently used widely. >> If your patches don't make it substantially worse, I won't have a >> problem with them. Bonus points for removing DOUTs though :) > > Ok, this is good to know. With some of these patches I will have > opportunities to remove DOUTS.Nice! Thanks,> What's the rationale for getting rid of it?The big issue is things like this: DOUT << foo.getName() << "\n"; When -debug is disable and even when assertions are turned off, foo.getName() is still called. When you use: DEBUG(errs() << foo.getName() << "\n"); When assertions are turned off, the call doesn't exist. It is also a lot less "magic". -Chris
On Tuesday 04 August 2009 18:24, Chris Lattner wrote:> The big issue is things like this: > > DOUT << foo.getName() << "\n"; > > When -debug is disable and even when assertions are turned off, > foo.getName() is still called. When you use:Yep, that's a problem.> DEBUG(errs() << foo.getName() << "\n"); > > When assertions are turned off, the call doesn't exist. It is also a > lot less "magic".Why doesn't DEBUG(DOUT << foo.getName() << "\n"); work? That's how I've always done it. A bit redundant perhaps, but it works. In any event, errs() is probably nicer. I'll have to see if I can do some of the tricks I did with DOUT in these patches. I think so, but I may be asking questions in the future. :) -Dave