This is the mail archive of the gcc-patches@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: Stop java making non-canonical trees


Nathan Sidwell writes:

 > I discovered java was creating a COMPONENT_REF (a tcc_reference
 > class node) with a _TYPE as operand0 (rather than an _EXPR or
 > equivalent).  This is getting in the way of some cleanups I'm
 > doing.
 > 
 > I've fixed this by placing the necessary _TYPE as the type of a
 > NOP_EXPR, which is then used as operand 0 of the COMPONENT_REF.
 > Java is using this COMPONENT_REF as a sort of place holder. An
 > alternative would have been a java specific node, but that looked
 > like more work -- AFAICT java has no bespoke nodes, so the entire
 > infrastructure for that would need implementing.
 > 
 > booted & tested on i686-pc-linux-gnu, ok?
 > 
 > 2005-08-08  Nathan Sidwell  <nathan@codesourcery.com>
 > 
 > 	* class.c (build_class_ref): Wrap the primary class type in a
 > 	NOP_EXPR.
 > 	* parse.y (java_complete_lhs) <COMPONENT_REF case>: Extract the
 > 	primary class type from the NOP_EXPR in which it was placed.
 > 

This looks okay, but I'm just hoping that there isn't any code that
relies on the type being there.  

I know that the Java front end uses some trees in unusual ways, but
that was OK (when gcj was written) as long as everything was fixed up
at expansion time.

Andrew.


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