This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: working on type declaration
- From: Ian Lance Taylor <iant at google dot com>
- To: <piervit at pvittet dot com>
- Cc: <gcc-help at gcc dot gnu dot org>
- Date: Wed, 16 Mar 2011 14:29:01 -0700
- Subject: Re: working on type declaration
- References: <f3a7aefe46380488acd56765e332cfad@localhost>
<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