Commit df05a794 by Mark Mitchell Committed by Mark Mitchell

name-lookup.c (set_inherited_value_binding_p): Add class_type parameter.

	* name-lookup.c (set_inherited_value_binding_p): Add class_type
	parameter.
	(get_class_binding): Adjust.
	(push_class_level_binding): Don't use set_inherited_value_binding_p.

From-SVN: r84757
parent 132c7dd3
2004-07-15 Mark Mitchell <mark@codesourcery.com>
* name-lookup.c (set_inherited_value_binding_p): Add class_type
parameter.
(get_class_binding): Adjust.
(push_class_level_binding): Don't use set_inherited_value_binding_p.
2004-07-15 Nathan Sidwell <nathan@codesourcery.com> 2004-07-15 Nathan Sidwell <nathan@codesourcery.com>
* class.c(finish_struct_bits): Don't set TYPE_HAS_CONVERSION here. * class.c(finish_struct_bits): Don't set TYPE_HAS_CONVERSION here.
...@@ -11,9 +18,6 @@ ...@@ -11,9 +18,6 @@
2004-07-14 Mark Mitchell <mark@codesourcery.com> 2004-07-14 Mark Mitchell <mark@codesourcery.com>
* lex.c (cxx_make_type): Remove call to get_pointer_type. * lex.c (cxx_make_type): Remove call to get_pointer_type.
(set_inherited_value_binding_p): Add class_type parameter.
(get_class_binding): Adjust.
(push_class_level_binding): Don't use set_inherited_value_binding_p.
* cp-tree.h (IDENTIFIER_VALUE): Remove. * cp-tree.h (IDENTIFIER_VALUE): Remove.
(BINFO_PUSHDECLS_MARKED): Likewise. (BINFO_PUSHDECLS_MARKED): Likewise.
......
...@@ -2640,10 +2640,11 @@ poplevel_class (void) ...@@ -2640,10 +2640,11 @@ poplevel_class (void)
/* Set INHERITED_VALUE_BINDING_P on BINDING to true or false, as /* Set INHERITED_VALUE_BINDING_P on BINDING to true or false, as
appropriate. DECL is the value to which a name has just been appropriate. DECL is the value to which a name has just been
bound. */ bound. CLASS_TYPE is the class in which the lookup occurred. */
static void static void
set_inherited_value_binding_p (cxx_binding *binding, tree decl) set_inherited_value_binding_p (cxx_binding *binding, tree decl,
tree class_type)
{ {
if (binding->value == decl && TREE_CODE (decl) != TREE_LIST) if (binding->value == decl && TREE_CODE (decl) != TREE_LIST)
{ {
...@@ -2657,7 +2658,7 @@ set_inherited_value_binding_p (cxx_binding *binding, tree decl) ...@@ -2657,7 +2658,7 @@ set_inherited_value_binding_p (cxx_binding *binding, tree decl)
context = context_for_name_lookup (decl); context = context_for_name_lookup (decl);
} }
if (is_properly_derived_from (current_class_type, context)) if (is_properly_derived_from (class_type, context))
INHERITED_VALUE_BINDING_P (binding) = 1; INHERITED_VALUE_BINDING_P (binding) = 1;
else else
INHERITED_VALUE_BINDING_P (binding) = 0; INHERITED_VALUE_BINDING_P (binding) = 0;
...@@ -2766,7 +2767,7 @@ get_class_binding (tree name, cxx_scope *scope) ...@@ -2766,7 +2767,7 @@ get_class_binding (tree name, cxx_scope *scope)
scope); scope);
/* This is a class-scope binding, not a block-scope binding. */ /* This is a class-scope binding, not a block-scope binding. */
LOCAL_BINDING_P (binding) = 0; LOCAL_BINDING_P (binding) = 0;
set_inherited_value_binding_p (binding, value_binding); set_inherited_value_binding_p (binding, value_binding, class_type);
} }
else else
binding = NULL; binding = NULL;
...@@ -2888,13 +2889,8 @@ push_class_level_binding (tree name, tree x) ...@@ -2888,13 +2889,8 @@ push_class_level_binding (tree name, tree x)
{ {
binding->value = x; binding->value = x;
/* It is always safe to clear INHERITED_VALUE_BINDING_P /* It is always safe to clear INHERITED_VALUE_BINDING_P
here. That flag is only set when setup_class_bindings here. This function is only used to register bindings
inserts a binding from a base class, and from with the class definition itself. */
setup_class_bindings only inserts a binding once for
every name declared in the class and its base classes.
So, if we see a second binding for this name, it must be
coming from a definition in the body of the class
itself. */
INHERITED_VALUE_BINDING_P (binding) = 0; INHERITED_VALUE_BINDING_P (binding) = 0;
POP_TIMEVAR_AND_RETURN (TV_NAME_LOOKUP, true); POP_TIMEVAR_AND_RETURN (TV_NAME_LOOKUP, true);
} }
...@@ -2918,10 +2914,6 @@ push_class_level_binding (tree name, tree x) ...@@ -2918,10 +2914,6 @@ push_class_level_binding (tree name, tree x)
ok = true; ok = true;
} }
/* Determine whether or not this binding is from a base class. */
binding = IDENTIFIER_BINDING (name);
set_inherited_value_binding_p (binding, decl);
POP_TIMEVAR_AND_RETURN (TV_NAME_LOOKUP, ok); POP_TIMEVAR_AND_RETURN (TV_NAME_LOOKUP, ok);
} }
......
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