From 195590126aec10f823cb1562f45fa03a0931e004 Mon Sep 17 00:00:00 2001 From: Alexandre Petit-Bianco Date: Thu, 31 May 2001 16:40:54 -0700 Subject: [PATCH] parse.y (lookup_field_wrapper): Test `name' code. 2001-05-31 Alexandre Petit-Bianco * parse.y (lookup_field_wrapper): Test `name' code. (resolve_qualified_expression_name): Test `qual_wfl' code. (qualify_ambiguous_name): Handle `CONVERT_EXPR', fixe indentation, handle `qual_wfl' by code. (maybe_build_primttype_type_ref): Test `wfl' code. (http://gcc.gnu.org/ml/gcc-patches/2001-05/msg02180.html ) From-SVN: r42764 --- gcc/java/ChangeLog | 8 ++++++++ gcc/java/parse.y | 19 ++++++++++++++----- 2 files changed, 22 insertions(+), 5 deletions(-) diff --git a/gcc/java/ChangeLog b/gcc/java/ChangeLog index 95b7445e5d2..f13bfbe6f2e 100644 --- a/gcc/java/ChangeLog +++ b/gcc/java/ChangeLog @@ -1,3 +1,11 @@ +2001-05-31 Alexandre Petit-Bianco + + * parse.y (lookup_field_wrapper): Test `name' code. + (resolve_qualified_expression_name): Test `qual_wfl' code. + (qualify_ambiguous_name): Handle `CONVERT_EXPR', fixe indentation, + handle `qual_wfl' by code. + (maybe_build_primttype_type_ref): Test `wfl' code. + 2001-05-23 Theodore Papadopoulo * Make-lang.in ($(srcdir)/java/gcj.info): Added dependencies on diff --git a/gcc/java/parse.y b/gcc/java/parse.y index 2b0038b6961..4ae8812e668 100644 --- a/gcc/java/parse.y +++ b/gcc/java/parse.y @@ -4079,7 +4079,7 @@ lookup_field_wrapper (class, name) /* Last chance: if we're within the context of an inner class, we might be trying to access a local variable defined in an outer context. We try to look for it now. */ - if (INNER_CLASS_TYPE_P (class)) + if (INNER_CLASS_TYPE_P (class) && TREE_CODE (name) == IDENTIFIER_NODE) { tree new_name; MANGLE_OUTER_LOCAL_VARIABLE_NAME (new_name, name); @@ -9221,7 +9221,8 @@ resolve_qualified_expression_name (wfl, found_decl, where_found, type_found) previous_call_static = 0; /* It can be the keyword THIS */ - if (EXPR_WFL_NODE (qual_wfl) == this_identifier_node) + if (TREE_CODE (qual_wfl) == EXPR_WITH_FILE_LOCATION + && EXPR_WFL_NODE (qual_wfl) == this_identifier_node) { if (!current_this) { @@ -9272,7 +9273,8 @@ resolve_qualified_expression_name (wfl, found_decl, where_found, type_found) } /* 15.10.2 Accessing Superclass Members using SUPER */ - if (EXPR_WFL_NODE (qual_wfl) == super_identifier_node) + if (TREE_CODE (qual_wfl) == EXPR_WITH_FILE_LOCATION + && EXPR_WFL_NODE (qual_wfl) == super_identifier_node) { tree node; /* Check on the restricted use of SUPER */ @@ -10844,6 +10846,10 @@ qualify_ambiguous_name (id) else if (code == INTEGER_CST) name = qual_wfl; + else if (code == CONVERT_EXPR && + TREE_CODE (TREE_OPERAND (qual_wfl, 0)) == EXPR_WITH_FILE_LOCATION) + name = TREE_OPERAND (qual_wfl, 0); + else if ((code == ARRAY_REF || code == CALL_EXPR || code == MODIFY_EXPR) && TREE_CODE (TREE_OPERAND (qual_wfl, 0)) == EXPR_WITH_FILE_LOCATION) name = EXPR_WFL_NODE (TREE_OPERAND (qual_wfl, 0)); @@ -10858,7 +10864,7 @@ qualify_ambiguous_name (id) qual_wfl = QUAL_WFL (qual); again = 1; } - else + else { name = EXPR_WFL_NODE (qual_wfl); if (!name) @@ -10886,8 +10892,10 @@ qualify_ambiguous_name (id) qual_wfl = QUAL_WFL (qual); if (TREE_CODE (qual_wfl) == CALL_EXPR) again = 1; - else + else if (TREE_CODE (qual_wfl) == EXPR_WITH_FILE_LOCATION) name = EXPR_WFL_NODE (qual_wfl); + else if (TREE_CODE (qual_wfl) == NEW_CLASS_EXPR) + name = TREE_OPERAND (qual_wfl, 0); this_found = 1; } /* If we have a SUPER, we set the context accordingly */ @@ -12408,6 +12416,7 @@ maybe_build_primttype_type_ref (rhs, wfl) if (TREE_CODE (n) == VAR_DECL && DECL_NAME (n) == TYPE_identifier_node && rhs_type == class_ptr_type + && TREE_CODE (wfl) == EXPR_WITH_FILE_LOCATION && TREE_CODE (EXPR_WFL_NODE (wfl)) == IDENTIFIER_NODE) { const char *self_name = IDENTIFIER_POINTER (EXPR_WFL_NODE (wfl)); -- 2.30.2