This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: #import and PCH
- From: Neil Booth <neil at daikokuya dot co dot uk>
- To: Geoffrey Keating <gkeating at apple dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Fri, 24 Jan 2003 21:24:38 +0000
- Subject: Re: #import and PCH
- References: <200301242040.h0OKebh1007933@keatge.apple.com>
Geoffrey Keating wrote:-
> #import worked by setting a flag bit on cpplib's hash table. This is
> somewhat annoying from a PCH perspective, and is kind of ugly too.
> This patch changes the behaviour so that #import uses macro
> definitions to track whether a header is included or not, and then
> PCH works with it automatically.
How about the include guard being the simplified path name, preceded
by an invalid identifier char? IMO this should be done in cppfiles.c
to share the same code. cpplib.c might not need to change at all, and
it avoids bugs I think are present in your implementation.
At present cpplib considers files the same iff their simplified name
is the same, so that with an invalid leading or trailing char should
be the guard macro. <> or "" is irrelevant.
Neil.