This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Basic frontend question about layout
- From: Andrew Pinski <pinskia at gmail dot com>
- To: Jerry Quinn <jlquinn at optonline dot net>
- Cc: "gcc at gcc dot gnu dot org" <gcc at gcc dot gnu dot org>
- Date: Tue, 23 Jun 2009 20:52:04 -0700
- Subject: Re: Basic frontend question about layout
- References: <1245815328.4098.13.camel@cerberus.qb5.org>
On Tue, Jun 23, 2009 at 8:48 PM, Jerry Quinn<jlquinn@optonline.net> wrote:
> Hi, folks,
>
> I'm having trouble seeing how layout is specified at the GENERIC level
> for RECORD_TYPEs. ÂThe docs and comments in tree.def say that you cannot
> rely on the order of fields of the type. ÂIn stor-layout.c,
> layout_types() seems to do the obvious thing, taking the fields in
> order, but the docs make it sound like there is no way to be sure what
> you'll get.
> Could someone please clear up my confusion?
The confusion here is that layout_types is separate from the rest of
the middle-end and the front-end could do the layout themselves and
the front-end calls layout_type if it does not do the layout itself.
So for an example, Ada layouts the records themselves and some times
has a different order of the fields than the layouted offsets.
Thanks,
Andrew Pinski