This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: [patch RFC] cpp macro surgery
- To: Phil Edwards <pedwards at disaster dot jaj dot com>
- Subject: Re: [patch RFC] cpp macro surgery
- From: Benjamin Kosnik <bkoz at redhat dot com>
- Date: Sat, 3 Mar 2001 12:44:57 -0800 (PST)
- cc: libstdc++ at gcc dot gnu dot org
> 1) Style cleanups as per C++STYLE items. Very few of these. (Wrong
> indentation, chunks of blank lines, nothing killer.)
Sooooo nice.
> 2) More comments in c++config as to what macro has what effect.
Great.
> 3) Most importantly, lots of cpp macro cleanup all through the headers;
> this also cleans out lots of macros definitions in c++config. The generic
> SGI STL is just chock full of stuff like
>
> #if we have partial ordering of template functions
> do cool things
> #else
> kludge around it
> #endif
>
> and
>
> #if ! (we're using GCC 2.7 or SGI 5.3 or (some compiler from the
> beginning of the Epoch))
> standard-conforming code
> #endif
>
> There's no sense in having cpplib do the exact same tests over and over and
> always coming up with the same known results. So conditionally compiled
> code that /never/ happens is removed with this patch, 'prox 160KB worth.
>
> This also replaces backwards-combatible macros like
>
> #define __STD_QUALIFIER std::
>
> with their values directly; there's no way the current code could be
> compiled without namespaces, so there's no point in supporting hooks
> to disable them, etc. Likewise for templates, certain keywords, etc.
> Makes the code much easier to read.
Fantastic. Were you able to time compilation speeds with the pruned
headers? Is there any noticable difference?
> - things dealing with the two SGI STL pthread headers; those are
> hideous and I don't feel like dealing with them right now, also
> they aren't used much
I've been avoiding this work too. Thread consistency is a libstdc++, gcc,
libjava issue that is going to have to be done sanely by everybody.
> All the files that I touched that already had an FSF copyright had 2001
> added to the year (most already had it).
Ok.
> For changes like __STD::foo -> std::foo, naturally the whole line is
> included twice in the diff, so the patch is about 300K and needed zipping.
Wow. Ok, well can you post a URL to the patch? That might be the way to
go. Or post the gzipped patch.
I'm really interested in the timing difference. (Just a ball park, it
took the 'make check' routines x with and y without would be fine.)
thanks again for doing this.
-benjamin