This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: PATCH to c-commonc.c, preliminary for PR/3865 fix
On Sat, Aug 31, 2002 at 08:24:32AM +0100, Neil Booth wrote:
> Zack Weinberg wrote:-
>
> > I believe it would be more efficient to handle these macros in
> > cppmacro.c:_cpp_builtin_macro_text, taking their values from a
> > structure filled in by c-common.c and passed into cpplib. However,
> > thinking about it a bit more, this is premature optimization; never
> > mind.
>
> Sometime in 3.4 I might improve this area a bit. e.g. it is probably
> worth having a cpp_define_bool (macroname, on) which defines macroname
> to be 1 or 0. We could avoid all the buffer pushing, lexing and popping
> in this common case (>80%?)
It's an interesting idea. Didn't we have problems with that kind of
optimization before? That was with macros defined to the empty
string, though, maybe defined to a single token wouldn't be as much of
a problem.
I was mainly thinking about reducing initialization overhead, not
macro expansion overhead.
zw