This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: non canonical tree in java
- From: Andrew Pinski <pinskia at physics dot uc dot edu>
- To: nathan at codesourcery dot com (Nathan Sidwell)
- Cc: tromey at redhat dot com (Tom Tromey), aph at redhat dot com (Andrew Haley), gcc at gcc dot gnu dot org (gcc mailing list)
- Date: Wed, 3 Aug 2005 13:53:36 -0400 (EDT)
- Subject: Re: non canonical tree in java
>
> java is creating a COMPONENT_REF node where the first operand is a RECORD_TYPE,
> rather than an expresion or DECL node. This is created at java/class.c:1014
>
> prim_class = lookup_class (get_identifier (prim_class_name));
> return build3 (COMPONENT_REF, NULL_TREE,
> prim_class, TYPE_identifier_node, NULL_TREE);
>
> here PRIM_CLASS is the RECORD_TYPE of the class. This usage disagrees with the
> requirements for a COMPONENT_REF in tree.def
> /* Value is structure or union component.
> Operand 0 is the structure or union (an expression).
> Operand 1 is the field (a node of type FIELD_DECL).
> Operand 2, if present, is the value of DECL_FIELD_OFFSET, measured
> in units of DECL_OFFSET_ALIGN / BITS_PER_UNIT. */
> DEFTREECODE (COMPONENT_REF, "component_ref", tcc_reference, 3)
>
> it is interfering with some cleanups I'm trying to do. What would be the best
> way of making java compliant? Have lookup_class return a suitable VAR_DECL
> node? I'm not sure where this then gets used ...
The java front-end later on replaces prim_class with the correct tree, witness how
the type of COMPONENT_REF is NULL.
-- Pinski