This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: PCH, and more generally C++ parser performance
- To: geoffk at cygnus dot com (Geoff Keating)
- Subject: Re: PCH, and more generally C++ parser performance
- From: Joe Buck <jbuck at racerx dot synopsys dot com>
- Date: Tue, 29 Aug 2000 17:31:27 -0700 (PDT)
- Cc: zack at wolery dot cumb dot org (Zack Weinberg), shebs at apple dot com (Stan Shebs), gcc at gcc dot gnu dot org
> I claim (and I'd be interested to know if anyone has a counterexample)
> that if an identifier is never used other than to be declared or
> defined, then program behaviour is the same as if those declarations
> were never made.
There are a couple of things that you're of course already aware of, like
constructors and destructors that may have side effects, and the impact
that the existence of a declaration may have on name resolution.
> So, for instance, if we have something like
>
> #include <everything.h>
> int foo (int bar)
> {
> bar = f(g(i<3>));
> }
>
> then during parsing, everything relating to "foo", "bar", "f", "g",
> "i" gets loaded from a pre-compiled header file, as are their types
> and so on.
The only complication I can think of is that
#include <everything.h>
may also instantiate a static file-scope object that has a constructor.