This is the mail archive of the gcc@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]

question about tree format


This is a question about the tree format, the intermediate
representation used by GCC (Ch. 18 of manual).
(I'm using GCC 3.0.1)

For a declaration like

struct TAG { int i; } r;

gcc produces a different chain of decl nodes in the tree, depending on 
whether the declaration occurs inside a scope or not.

On the outermost (file) level, it leads to a chain of
first a type_decl for the tagged record_type,
then a var_decl for r.

Inside a scope, the type_decl for the tagged record_type is missing
if (and only if) the declaration is the first inside the scope.

Is there any logic behind this irregularity?

thanks for any help,
--dennis.


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