This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Gengtype : strange code in output_type_enum
- From: Laurynas Biveinis <laurynas dot biveinis at gmail dot com>
- To: jeremie dot salvucci at free dot fr
- Cc: gcc <gcc at gcc dot gnu dot org>, basile <basile at starynkevitch dot net>
- Date: Fri, 27 Aug 2010 14:47:06 +0200
- Subject: Re: Gengtype : strange code in output_type_enum
- References: <1360893126.445931282912919305.JavaMail.root@zimbra30-e5.priv.proxad.net>
2010/8/27 <jeremie.salvucci@free.fr>:
> We think that the enum type_kind discriminates fields union in struct type. So for TYPE_PARAM_STRUCT we believe that
> the param_struct field of union u inside struct type is used. If this is true, the test s->u.s.line.file != NULL is meaningless when s->kind == TYPE_PARAM_STRUCT, it should be s->u.param_struct.line.file != NULL instead in our opinion.
>
>
> Or can a type have a kind TYPE_PARAM_STRUCT and only have s->u.s valid? It might be related to the code in new_structure near line Â638 of gengtype.c which sets ls->kind = TYPE_LANG_STRUCT.
>
> Perhaps TYPE_PARAM_STRUCT has two different roles. If that is indeed the case, we have to distinguish them when serializing gengtype's state.
I don't have time to investigate this right now to come up with an
answer, but did you try producing gengtype debugging dump and looking
there for structs that have these combinations of properties?
Especially since -
> However, the existing code appears to work but we don't understand why.
Cheers,
--
Laurynas