Hi Bill, On Thu, 2006-11-16 at 17:44 -0800, Bill Wendling wrote: > On 11/16/06, Reid Spencer <[EMAIL PROTECTED]> wrote: > > While this may not print anything when NDEBUG is *not* defined, it isn't > > sufficient. You're going to leave template functions scattered all over > > the place and calls to them. The existing solution completely eliminates > > the code from an NDEBUG build. That's what we want. What's wrong with > > the existing solution? Or, perhaps a combination is needed. Something > > like: > > > > DEBUG(DOUT << "This is a debug message\n"); > > > Hi Reid, > > Basically, this is to get rid of static c'tor/d'tors scattered all > over the source tree. (You get them whenever you #include <iostream>.) > A smart compiler should be able to remove all of the empty functions > because they don't have any side-effects.
I understand the motivation for the change and I commend it, but I'm concerned about getting it right. You're assuming a few things: a) the compiler is smart enough to get rid of calls that have no side effects, b) the compiler knows how to determine if a function has no side effects without help (operator<< isn't marked "pure"), and c) that there aren't any side effects. c) can probably be proven by your iostream implementation but a) and b) are a little tougher. Can we build an optimized, with symbols (-g -O2) version of one of these modules and see if those symbols are getting removed ? If so, I'm fine with it. If not, we need a new strategy. Reid. _______________________________________________ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits