OSDN Git Service

2000-07-21 Alexandre Petit-Bianco <apbianco@cygnus.com>
authorapbianco <apbianco@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 21 Jul 2000 18:11:52 +0000 (18:11 +0000)
committerapbianco <apbianco@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 21 Jul 2000 18:11:52 +0000 (18:11 +0000)
* parse.y (java_complete_lhs): LOOP_EXPR:, SWITCH_EXPR: the node
or its first operand can be error marks.

2000-07-20  Alexandre Petit-Bianco  <apbianco@cygnus.com>

* parse.h (SET_TYPE_FOR_RESOLUTION): Use GET_CPC.
* parse.y (method_header): Likewise.

2000-07-19  Alexandre Petit-Bianco  <apbianco@cygnus.com>

* parse.y (find_as_inner_class): Handle the case where the
enclosing context of an innerclass has been loaded as bytecode.

(Side gcj/225 bug fix and some cleanup:
 http://gcc.gnu.org/ml/gcc-patches/2000-07/msg00832.html)

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@35176 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/java/ChangeLog
gcc/java/parse.h
gcc/java/parse.y

index e1b9699..d8f99ad 100644 (file)
@@ -1,3 +1,18 @@
+2000-07-21  Alexandre Petit-Bianco  <apbianco@cygnus.com>
+
+       * parse.y (java_complete_lhs): LOOP_EXPR:, SWITCH_EXPR: the node
+       or its first operand can be error marks.
+
+2000-07-20  Alexandre Petit-Bianco  <apbianco@cygnus.com>
+
+       * parse.h (SET_TYPE_FOR_RESOLUTION): Use GET_CPC.
+       * parse.y (method_header): Likewise.
+
+2000-07-19  Alexandre Petit-Bianco  <apbianco@cygnus.com>
+
+       * parse.y (find_as_inner_class): Handle the case where the
+       enclosing context of an innerclass has been loaded as bytecode.
+
 2000-07-18  Jeff Sturm  <jeff.sturm@appnet.com>
 
        * lang-specs.h: Added %(jc1) to java compiler options.
index 687dc95..50a9e3e 100644 (file)
@@ -537,7 +537,7 @@ typedef struct _jdeplist {
   {                                                                    \
     tree returned_type;                                                        \
     (CHAIN) = 0;                                                       \
-    if (TREE_TYPE (ctxp->current_parsed_class) == object_type_node     \
+    if (TREE_TYPE (GET_CPC ()) == object_type_node                     \
        && TREE_CODE (TYPE) == EXPR_WITH_FILE_LOCATION                  \
        && EXPR_WFL_NODE (TYPE) == unqualified_object_id_node)          \
       (TYPE) = object_type_node;                                       \
index af7b19b..93eff86 100644 (file)
@@ -3492,7 +3492,18 @@ find_as_inner_class (enclosing, name, cl)
   else
     qual = build_tree_list (build_expr_wfl (name, NULL, 0, 0), NULL_TREE);
 
-  return find_as_inner_class_do (qual, enclosing);
+  if (!(to_return = find_as_inner_class_do (qual, enclosing)))
+    {
+      /* It might be the case that the enclosing class was loaded as
+        bytecode, in which case it will be missing the
+        DECL_INNER_CLASS_LIST. We build a fully qualified internal
+        innerclass name and we try to load it. */
+      tree fqin = identifier_subst (name, "", '.', '$', "");
+      tree ptr;
+      BUILD_PTR_FROM_NAME (ptr, fqin);
+      to_return = resolve_class (NULL_TREE, ptr, NULL_TREE, cl);
+    }
+  return to_return;
 }
 
 /* We go inside the list of sub classes and try to find a way
@@ -4290,7 +4301,7 @@ method_header (flags, type, mdecl, throws)
          && !CLASS_INTERFACE (TYPE_NAME (this_class)))
        parse_error_context 
          (id, "Class `%s' must be declared abstract to define abstract method `%s'", 
-          IDENTIFIER_POINTER (DECL_NAME (ctxp->current_parsed_class)),
+          IDENTIFIER_POINTER (DECL_NAME (GET_CPC ())),
           IDENTIFIER_POINTER (EXPR_WFL_NODE (id)));
     }
 
@@ -10984,7 +10995,7 @@ java_complete_lhs (node)
       else
        node = patch_switch_statement (node);
 
-      if (TREE_OPERAND (node, 0) == error_mark_node)
+      if (node == error_mark_node || TREE_OPERAND (node, 0) == error_mark_node)
        nn = error_mark_node;
       else
        {