This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: what are exactly GCC core types?
- From: "Joseph S. Myers" <joseph at codesourcery dot com>
- To: Basile Starynkevitch <basile at starynkevitch dot net>
- Cc: gcc at gcc dot gnu dot org
- Date: Tue, 22 Jun 2010 12:19:24 +0000 (UTC)
- Subject: Re: what are exactly GCC core types?
- References: <1277187161.24042.21.camel@glinka>
On Tue, 22 Jun 2010, Basile Starynkevitch wrote:
> Hello,
>
> What are exactly GCC code types, defined in gcc/coretypes.h?
The main purpose of putting types in coretypes.h is to separate interface
from implementation. See the comments in that header.
/* Provide forward declarations of core types which are referred to by
most of the compiler. This allows header files to use these types
(e.g. in function prototypes) without concern for whether the full
definitions are visible. Some other declarations that need to be
universally visible are here, too.
> However, I don't understand why gimple_seq_node is a core type. It seems
> rarely used (outside of gimple*.[ch] files), and I would imagine it
> could be kept in gimple.h.
If a type in coretypes.h is not in fact needed by any source files that do
not also need to know about the fields of that type, then it may be
appropriate to move it out of coretypes.h.
If there is code using a header to get a declaration of a type, but not
needing the fields of that type, it may be appropriate to move it into
coretypes.h.
--
Joseph S. Myers
joseph@codesourcery.com