This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] Java: minor patch.
- To: gcc-patches at gcc dot gnu dot org
- Subject: [PATCH] Java: minor patch.
- From: Alexandre Petit-Bianco <apbianco at cygnus dot com>
- Date: Mon, 26 Jun 2000 00:05:35 -0700
- Reply-to: apbianco at redhat dot com
I'm checking in this minor, mostly cleanup patch.
./A
2000-06-25 Alexandre Petit-Bianco <apbianco@cygnus.com>
* parse.y (do_resolve_class): Minor optimiztion in the package
list search. Removed unecessary test and return statement.
(valid_ref_assignconv_cast_p): Order of arguments to
enclosing_context_p fixed.
Index: parse.y
===================================================================
RCS file: /cvs/gcc/egcs/gcc/java/parse.y,v
retrieving revision 1.179
diff -u -p -r1.179 parse.y
--- parse.y 2000/06/22 05:17:35 1.179
+++ parse.y 2000/06/26 06:58:03
@@ -5497,7 +5497,12 @@ do_resolve_class (enclosing, class_type,
if (!QUALIFIED_P (TYPE_NAME (class_type)))
{
tree package;
- for (package = package_list; package; package = TREE_CHAIN (package))
+
+ /* If there is a current package (ctxp->package), it's the first
+ element of package_list and we can skip it. */
+ for (package = (ctxp->package ?
+ TREE_CHAIN (package_list) : package_list);
+ package; package = TREE_CHAIN (package))
if ((new_class_decl = qualify_and_find (class_type,
TREE_PURPOSE (package),
TYPE_NAME (class_type))))
@@ -5510,9 +5515,6 @@ do_resolve_class (enclosing, class_type,
(cl ? cl : lookup_cl (decl))))
return NULL_TREE;
- if ((new_class_decl = IDENTIFIER_CLASS_VALUE (TYPE_NAME (class_type))))
- return new_class_decl;
-
/* 6- Last call for a resolution */
return IDENTIFIER_CLASS_VALUE (TYPE_NAME (class_type));
}
@@ -12038,7 +12040,7 @@ valid_ref_assignconv_cast_p (source, des
if (TYPE_CLASS_P (dest))
return (source == dest
|| inherits_from_p (source, dest)
- || enclosing_context_p (dest, source /*source, dest*/)
+ || enclosing_context_p (source, dest)
|| (cast && inherits_from_p (dest, source)));
if (TYPE_INTERFACE_P (dest))
{