This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
question about tree format
- From: Dennis Dams <dennis at research dot bell-labs dot com>
- To: gcc at gcc dot gnu dot org
- Date: Mon, 11 Feb 2002 18:39:36 -0500 (EST)
- Subject: question about tree format
- Reply-to: dennis at research dot bell-labs dot com
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.