Commit d6baf6f5 by Alexandre Petit-Bianco Committed by Alexandre Petit-Bianco

parse.y (do_resolve_class): Minor optimiztion in the package list search.

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.

From-SVN: r34705
parent cab10d56
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.
2000-06-24 Tom Tromey <tromey@cygnus.com> 2000-06-24 Tom Tromey <tromey@cygnus.com>
* expr.c (lookup_field): Print error and return error_mark_node if * expr.c (lookup_field): Print error and return error_mark_node if
......
...@@ -8195,7 +8195,12 @@ do_resolve_class (enclosing, class_type, decl, cl) ...@@ -8195,7 +8195,12 @@ do_resolve_class (enclosing, class_type, decl, cl)
if (!QUALIFIED_P (TYPE_NAME (class_type))) if (!QUALIFIED_P (TYPE_NAME (class_type)))
{ {
tree package; 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, if ((new_class_decl = qualify_and_find (class_type,
TREE_PURPOSE (package), TREE_PURPOSE (package),
TYPE_NAME (class_type)))) TYPE_NAME (class_type))))
...@@ -8208,9 +8213,6 @@ do_resolve_class (enclosing, class_type, decl, cl) ...@@ -8208,9 +8213,6 @@ do_resolve_class (enclosing, class_type, decl, cl)
(cl ? cl : lookup_cl (decl)))) (cl ? cl : lookup_cl (decl))))
return NULL_TREE; return NULL_TREE;
if ((new_class_decl = IDENTIFIER_CLASS_VALUE (TYPE_NAME (class_type))))
return new_class_decl;
/* 6- Last call for a resolution */ /* 6- Last call for a resolution */
return IDENTIFIER_CLASS_VALUE (TYPE_NAME (class_type)); return IDENTIFIER_CLASS_VALUE (TYPE_NAME (class_type));
} }
...@@ -14738,7 +14740,7 @@ valid_ref_assignconv_cast_p (source, dest, cast) ...@@ -14738,7 +14740,7 @@ valid_ref_assignconv_cast_p (source, dest, cast)
if (TYPE_CLASS_P (dest)) if (TYPE_CLASS_P (dest))
return (source == dest return (source == dest
|| inherits_from_p (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))); || (cast && inherits_from_p (dest, source)));
if (TYPE_INTERFACE_P (dest)) if (TYPE_INTERFACE_P (dest))
{ {
......
...@@ -5497,7 +5497,12 @@ do_resolve_class (enclosing, class_type, decl, cl) ...@@ -5497,7 +5497,12 @@ do_resolve_class (enclosing, class_type, decl, cl)
if (!QUALIFIED_P (TYPE_NAME (class_type))) if (!QUALIFIED_P (TYPE_NAME (class_type)))
{ {
tree package; 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, if ((new_class_decl = qualify_and_find (class_type,
TREE_PURPOSE (package), TREE_PURPOSE (package),
TYPE_NAME (class_type)))) TYPE_NAME (class_type))))
...@@ -5510,9 +5515,6 @@ do_resolve_class (enclosing, class_type, decl, cl) ...@@ -5510,9 +5515,6 @@ do_resolve_class (enclosing, class_type, decl, cl)
(cl ? cl : lookup_cl (decl)))) (cl ? cl : lookup_cl (decl))))
return NULL_TREE; return NULL_TREE;
if ((new_class_decl = IDENTIFIER_CLASS_VALUE (TYPE_NAME (class_type))))
return new_class_decl;
/* 6- Last call for a resolution */ /* 6- Last call for a resolution */
return IDENTIFIER_CLASS_VALUE (TYPE_NAME (class_type)); return IDENTIFIER_CLASS_VALUE (TYPE_NAME (class_type));
} }
...@@ -12040,7 +12042,7 @@ valid_ref_assignconv_cast_p (source, dest, cast) ...@@ -12040,7 +12042,7 @@ valid_ref_assignconv_cast_p (source, dest, cast)
if (TYPE_CLASS_P (dest)) if (TYPE_CLASS_P (dest))
return (source == dest return (source == dest
|| inherits_from_p (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))); || (cast && inherits_from_p (dest, source)));
if (TYPE_INTERFACE_P (dest)) if (TYPE_INTERFACE_P (dest))
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment