* non canonical tree in java
@ 2005-08-03 17:49 Nathan Sidwell
2005-08-03 17:55 ` Andrew Pinski
0 siblings, 1 reply; 4+ messages in thread
From: Nathan Sidwell @ 2005-08-03 17:49 UTC (permalink / raw)
To: Tom Tromey, Andrew Haley; +Cc: gcc mailing list
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 ...
nathan
--
Nathan Sidwell :: http://www.codesourcery.com :: CodeSourcery LLC
nathan@codesourcery.com :: http://www.planetfall.pwp.blueyonder.co.uk
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: non canonical tree in java
2005-08-03 17:49 non canonical tree in java Nathan Sidwell
@ 2005-08-03 17:55 ` Andrew Pinski
2005-08-03 18:05 ` Nathan Sidwell
0 siblings, 1 reply; 4+ messages in thread
From: Andrew Pinski @ 2005-08-03 17:55 UTC (permalink / raw)
To: Nathan Sidwell; +Cc: Tom Tromey, Andrew Haley, gcc mailing list
>
> 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
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: non canonical tree in java
2005-08-03 17:55 ` Andrew Pinski
@ 2005-08-03 18:05 ` Nathan Sidwell
2005-08-03 18:15 ` Andrew Pinski
0 siblings, 1 reply; 4+ messages in thread
From: Nathan Sidwell @ 2005-08-03 18:05 UTC (permalink / raw)
To: Andrew Pinski; +Cc: Tom Tromey, Andrew Haley, gcc mailing list
Andrew Pinski wrote:
> The java front-end later on replaces prim_class with the correct tree, witness how
> the type of COMPONENT_REF is NULL.
where does this happen? do you happen to know?
nathan
--
Nathan Sidwell :: http://www.codesourcery.com :: CodeSourcery LLC
nathan@codesourcery.com :: http://www.planetfall.pwp.blueyonder.co.uk
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: non canonical tree in java
2005-08-03 18:05 ` Nathan Sidwell
@ 2005-08-03 18:15 ` Andrew Pinski
0 siblings, 0 replies; 4+ messages in thread
From: Andrew Pinski @ 2005-08-03 18:15 UTC (permalink / raw)
To: Nathan Sidwell; +Cc: Andrew Haley, Tom Tromey, gcc mailing list
On Aug 3, 2005, at 2:05 PM, Nathan Sidwell wrote:
> Andrew Pinski wrote:
>
>> The java front-end later on replaces prim_class with the correct
>> tree, witness how
>> the type of COMPONENT_REF is NULL.
>
> where does this happen? do you happen to know?
Happens in java_complete_lhs in parse.y:
case COMPONENT_REF:
/* The first step in the re-write of qualified name handling.
FIXME.
So far, this is only to support PRIMTYPE.class ->
PRIMCLASS.TYPE. */
TREE_OPERAND (node, 0) = java_complete_tree (TREE_OPERAND (node,
0));
-- Pinski
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2005-08-03 18:15 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-08-03 17:49 non canonical tree in java Nathan Sidwell
2005-08-03 17:55 ` Andrew Pinski
2005-08-03 18:05 ` Nathan Sidwell
2005-08-03 18:15 ` Andrew Pinski
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).