public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* what are exactly GCC core types?
@ 2010-06-22  6:58 Basile Starynkevitch
  2010-06-22  7:05 ` Ian Lance Taylor
  2010-06-22 14:52 ` Joseph S. Myers
  0 siblings, 2 replies; 4+ messages in thread
From: Basile Starynkevitch @ 2010-06-22  6:58 UTC (permalink / raw)
  To: gcc

Hello,

What are exactly GCC code types, defined in gcc/coretypes.h?

Of course, they are very important types used in GCC. And there are
probably wired in gengtype (but maybe not all of them; I didn't check
for all; certainly gengtype handle tree & gimple specially in some
way.).

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.

I also don't understand why 
  union section;
  typedef union section section;
  struct cl_target_option;
  struct cl_optimization;
should be kept in gcc/coretypes.h


I could imagine that the transition to C++ might have to C++-ify these
core types (all of gcc/coretypes.h) very quickly, or on the contrary to
keep them as they are, without making a class of them, for a long time.

Do we have a clear criterium to add, keep, or remove a type from
gcc/coretypes.h?

Regards.

-- 
Basile STARYNKEVITCH         http://starynkevitch.net/Basile/
email: basile<at>starynkevitch<dot>net mobile: +33 6 8501 2359
8, rue de la Faiencerie, 92340 Bourg La Reine, France
*** opinions {are only mines, sont seulement les miennes} ***


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: what are exactly GCC core types?
  2010-06-22  6:58 what are exactly GCC core types? Basile Starynkevitch
@ 2010-06-22  7:05 ` Ian Lance Taylor
  2010-06-22  7:19   ` Manuel López-Ibáñez
  2010-06-22 14:52 ` Joseph S. Myers
  1 sibling, 1 reply; 4+ messages in thread
From: Ian Lance Taylor @ 2010-06-22  7:05 UTC (permalink / raw)
  To: basile; +Cc: gcc

Basile Starynkevitch <basile@starynkevitch.net> writes:

> What are exactly GCC code types, defined in gcc/coretypes.h?

They are types for which there was no obvious place to put them.

> Of course, they are very important types used in GCC. And there are
> probably wired in gengtype (but maybe not all of them; I didn't check
> for all; certainly gengtype handle tree & gimple specially in some
> way.).

gengtype only handles a few types specially.  There is no particular
connection between types recognized by gengtype and coretypes.h.
E.g., gengtype handles VEC specially, but it is not in coretypes.h.

> 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.

I agree.  I expect it's there just because gimple_seq is there.

> I also don't understand why 
>   union section;
>   typedef union section section;
>   struct cl_target_option;
>   struct cl_optimization;
> should be kept in gcc/coretypes.h

I don't know either.

> I could imagine that the transition to C++ might have to C++-ify these
> core types (all of gcc/coretypes.h) very quickly, or on the contrary to
> keep them as they are, without making a class of them, for a long time.

I don't think the transition to C++ will have to change any of these
types.  We should not make it a goal to convert all types to classes.

> Do we have a clear criterium to add, keep, or remove a type from
> gcc/coretypes.h?

No.

Ian

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: what are exactly GCC core types?
  2010-06-22  7:05 ` Ian Lance Taylor
@ 2010-06-22  7:19   ` Manuel López-Ibáñez
  0 siblings, 0 replies; 4+ messages in thread
From: Manuel López-Ibáñez @ 2010-06-22  7:19 UTC (permalink / raw)
  To: Ian Lance Taylor; +Cc: basile, gcc

On 22 June 2010 08:28, Ian Lance Taylor <iant@google.com> wrote:
> Basile Starynkevitch <basile@starynkevitch.net> writes:
>
>> What are exactly GCC code types, defined in gcc/coretypes.h?
>
> They are types for which there was no obvious place to put them.
>
>> Of course, they are very important types used in GCC. And there are
>> probably wired in gengtype (but maybe not all of them; I didn't check
>> for all; certainly gengtype handle tree & gimple specially in some
>> way.).
>
> gengtype only handles a few types specially.  There is no particular
> connection between types recognized by gengtype and coretypes.h.
> E.g., gengtype handles VEC specially, but it is not in coretypes.h.
>
>> 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.
>
> I agree.  I expect it's there just because gimple_seq is there.
>

Basile, if you can move it to gimple.h and bootstrap + regression
test, then I am pretty sure such a patch would be accepted. If moving
it breaks something, then probably there is a reason for it to be
there and if it is not easy to fix it, at least, you can add a
comment.

Manuel.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: what are exactly GCC core types?
  2010-06-22  6:58 what are exactly GCC core types? Basile Starynkevitch
  2010-06-22  7:05 ` Ian Lance Taylor
@ 2010-06-22 14:52 ` Joseph S. Myers
  1 sibling, 0 replies; 4+ messages in thread
From: Joseph S. Myers @ 2010-06-22 14:52 UTC (permalink / raw)
  To: Basile Starynkevitch; +Cc: gcc

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2010-06-22 12:19 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-06-22  6:58 what are exactly GCC core types? Basile Starynkevitch
2010-06-22  7:05 ` Ian Lance Taylor
2010-06-22  7:19   ` Manuel López-Ibáñez
2010-06-22 14:52 ` Joseph S. Myers

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).