This is the mail archive of the gcc-help@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: working on type declaration


<piervit@pvittet.com> writes:

> I would like to know at which level of GCC (GENERICS, GIMPLE...) I
> could get informations about the C types (created with typedef) which
> are defined.

Types are represented in GENERIC.  GIMPLE points to GENERIC as needed.

> I would like to parse type definition in order to know if the type is
> a pointer or not, for exemple, if I have the following type:
>
> typedef struct _account{
>   int    account_number;
>   float  balance;
> } * account;
>
>
> I have tried to look at GIMPLE and IPA, however it looks like, at this
> state, the work is already done and the use of the type are replaced
> by the use of a "struct account * ". Moreover I can't find where this
> struct is keept in gcc.

Any variable of that type will point to the TYPE_DECL which represents
the type.  In the C frontend, the namespace scope will have "account"
pointing to the TYPE_DECL; see c-decl.c.  After the C frontend, e.g., in
GIMPLE, that mapping is gone.

Ian


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