This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: #import and PCH


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]