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]

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


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