OSDN Git Service

* cp-tree.h, name-lookup.h, decl.c, decl2.c: Remove reference to
authorgdr <gdr@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 27 Sep 2003 01:55:13 +0000 (01:55 +0000)
committergdr <gdr@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 27 Sep 2003 01:55:13 +0000 (01:55 +0000)
macros  BINDING_SCOPE, BINDING_VALUE and BINDING_TYPE.

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

gcc/cp/ChangeLog
gcc/cp/cp-tree.h
gcc/cp/decl.c
gcc/cp/decl2.c
gcc/cp/name-lookup.c
gcc/cp/name-lookup.h

index ff621d2..cbf9b54 100644 (file)
@@ -1,3 +1,8 @@
+2003-09-27  Gabriel Dos Reis  <gdr@integrable-solutions.net>
+
+       * cp-tree.h, name-lookup.h, decl.c, decl2.c: Remove reference to
+       macros  BINDING_SCOPE, BINDING_VALUE and BINDING_TYPE.
+
 2003-09-26  Gabriel Dos Reis  <gdr@integrable-solutions.net>
 
        * decl.c (pop_binding_level, suspend_binding_level,
 2003-09-26  Gabriel Dos Reis  <gdr@integrable-solutions.net>
 
        * decl.c (pop_binding_level, suspend_binding_level,
@@ -14,7 +19,7 @@
        (cp_parser_member_declaration): Use it.
        (cp_parser_template_declaration_after_export): Likewise.
 
        (cp_parser_member_declaration): Use it.
        (cp_parser_template_declaration_after_export): Likewise.
 
-2003-09-22  Gabriel Dos Reis  <gcc@integrable-solutions.net>
+2003-09-22  Gabriel Dos Reis  <gdr@integrable-solutions.net>
 
        * cp-tree.h (scope_kind): Add new enumerator.
        (keep_next_level): Change parameter type to bool.
 
        * cp-tree.h (scope_kind): Add new enumerator.
        (keep_next_level): Change parameter type to bool.
index 5118b78..628a0c9 100644 (file)
@@ -379,10 +379,10 @@ typedef enum cp_id_kind
 
 /* The IDENTIFIER_BINDING is the innermost cxx_binding for the
     identifier.  It's PREVIOUS is the next outermost binding.  Each
 
 /* The IDENTIFIER_BINDING is the innermost cxx_binding for the
     identifier.  It's PREVIOUS is the next outermost binding.  Each
-    BINDING_VALUE is a DECL for the associated declaration.  Thus,
+    VALUE field is a DECL for the associated declaration.  Thus,
     name lookup consists simply of pulling off the node at the front
     of the list (modulo oddities for looking up the names of types,
     name lookup consists simply of pulling off the node at the front
     of the list (modulo oddities for looking up the names of types,
-    and such.)  You can use BINDING_SCOPE to determine the scope
+    and such.)  You can use SCOPE field to determine the scope
     that bound the name.  */
 #define IDENTIFIER_BINDING(NODE) \
   (LANG_IDENTIFIER_CAST (NODE)->bindings)
     that bound the name.  */
 #define IDENTIFIER_BINDING(NODE) \
   (LANG_IDENTIFIER_CAST (NODE)->bindings)
@@ -394,7 +394,7 @@ typedef enum cp_id_kind
 
 /* If IDENTIFIER_CLASS_VALUE is set, then NODE is bound in the current
    class, and IDENTIFIER_CLASS_VALUE is the value binding.  This is
 
 /* If IDENTIFIER_CLASS_VALUE is set, then NODE is bound in the current
    class, and IDENTIFIER_CLASS_VALUE is the value binding.  This is
-   just a pointer to the BINDING_VALUE of one of the bindings in the
+   just a pointer to the VALUE field of one of the bindings in the
    IDENTIFIER_BINDINGs list, so any time that this is non-NULL so is
    IDENTIFIER_BINDING.  */
 #define IDENTIFIER_CLASS_VALUE(NODE) \
    IDENTIFIER_BINDINGs list, so any time that this is non-NULL so is
    IDENTIFIER_BINDING.  */
 #define IDENTIFIER_CLASS_VALUE(NODE) \
index 52b3b60..51edfd2 100644 (file)
@@ -857,7 +857,7 @@ push_binding (tree id, tree decl, cxx_scope* level)
 
   /* Now, fill in the binding information.  */
   binding->previous = IDENTIFIER_BINDING (id);
 
   /* Now, fill in the binding information.  */
   binding->previous = IDENTIFIER_BINDING (id);
-  BINDING_SCOPE (binding) = level;
+  binding->scope = level;
   INHERITED_VALUE_BINDING_P (binding) = 0;
   LOCAL_BINDING_P (binding) = (level != class_binding_level);
 
   INHERITED_VALUE_BINDING_P (binding) = 0;
   LOCAL_BINDING_P (binding) = (level != class_binding_level);
 
@@ -953,7 +953,7 @@ push_class_binding (tree id, tree decl)
      other purpose.  */
   note_name_declared_in_class (id, decl);
 
      other purpose.  */
   note_name_declared_in_class (id, decl);
 
-  if (binding && BINDING_SCOPE (binding) == class_binding_level)
+  if (binding && binding->scope == class_binding_level)
     /* Supplement the existing binding.  */
     result = supplement_binding (IDENTIFIER_BINDING (id), decl);
   else
     /* Supplement the existing binding.  */
     result = supplement_binding (IDENTIFIER_BINDING (id), decl);
   else
@@ -965,11 +965,11 @@ push_class_binding (tree id, tree decl)
      because of the possibility of the `struct stat' hack; if DECL is
      a class-name or enum-name we might prefer a field-name, or some
      such.  */
      because of the possibility of the `struct stat' hack; if DECL is
      a class-name or enum-name we might prefer a field-name, or some
      such.  */
-  IDENTIFIER_CLASS_VALUE (id) = BINDING_VALUE (IDENTIFIER_BINDING (id));
+  IDENTIFIER_CLASS_VALUE (id) = IDENTIFIER_BINDING (id)->value;
 
   /* If this is a binding from a base class, mark it as such.  */
   binding = IDENTIFIER_BINDING (id);
 
   /* If this is a binding from a base class, mark it as such.  */
   binding = IDENTIFIER_BINDING (id);
-  if (BINDING_VALUE (binding) == decl && TREE_CODE (decl) != TREE_LIST)
+  if (binding->value == decl && TREE_CODE (decl) != TREE_LIST)
     {
       if (TREE_CODE (decl) == OVERLOAD)
        context = CP_DECL_CONTEXT (OVL_CURRENT (decl));
     {
       if (TREE_CODE (decl) == OVERLOAD)
        context = CP_DECL_CONTEXT (OVL_CURRENT (decl));
@@ -984,7 +984,7 @@ push_class_binding (tree id, tree decl)
       else
        INHERITED_VALUE_BINDING_P (binding) = 0;
     }
       else
        INHERITED_VALUE_BINDING_P (binding) = 0;
     }
-  else if (BINDING_VALUE (binding) == decl)
+  else if (binding->value == decl)
     /* We only encounter a TREE_LIST when push_class_decls detects an
        ambiguity.  Such an ambiguity can be overridden by a definition
        in this class.  */
     /* We only encounter a TREE_LIST when push_class_decls detects an
        ambiguity.  Such an ambiguity can be overridden by a definition
        in this class.  */
@@ -1015,14 +1015,14 @@ pop_binding (tree id, tree decl)
 
   /* The DECL will be either the ordinary binding or the type
      binding for this identifier.  Remove that binding.  */
 
   /* The DECL will be either the ordinary binding or the type
      binding for this identifier.  Remove that binding.  */
-  if (BINDING_VALUE (binding) == decl)
-    BINDING_VALUE (binding) = NULL_TREE;
-  else if (BINDING_TYPE (binding) == decl)
-    BINDING_TYPE (binding) = NULL_TREE;
+  if (binding->value == decl)
+    binding->value = NULL_TREE;
+  else if (binding->type == decl)
+    binding->type = NULL_TREE;
   else
     abort ();
 
   else
     abort ();
 
-  if (!BINDING_VALUE (binding) && !BINDING_TYPE (binding))
+  if (!binding->value && !binding->type)
     {
       /* We're completely done with the innermost binding for this
         identifier.  Unhook it from the list of bindings.  */
     {
       /* We're completely done with the innermost binding for this
         identifier.  Unhook it from the list of bindings.  */
@@ -1031,9 +1031,8 @@ pop_binding (tree id, tree decl)
       /* Add it to the free list.  */
       cxx_binding_free (binding);
 
       /* Add it to the free list.  */
       cxx_binding_free (binding);
 
-      /* Clear the BINDING_SCOPE so the garbage collector doesn't walk
-        it.  */
-      BINDING_SCOPE (binding) = NULL;
+      /* Clear the SCOPE so the garbage collector doesn't walk it.  */
+      binding->scope = NULL;
     }
 }
 
     }
 }
 
@@ -1250,8 +1249,7 @@ poplevel (int keep, int reverse, int functionbody)
            ns_binding = NULL_TREE;
 
          if (outer_binding
            ns_binding = NULL_TREE;
 
          if (outer_binding
-             && (BINDING_SCOPE (outer_binding)
-                 == current_binding_level->level_chain))
+             && outer_binding->scope == current_binding_level->level_chain)
            /* We have something like:
 
                 int i;
            /* We have something like:
 
                 int i;
@@ -1261,10 +1259,8 @@ poplevel (int keep, int reverse, int functionbody)
               keep the binding of the inner `i' in this case.  */
            pop_binding (DECL_NAME (link), link);
          else if ((outer_binding
               keep the binding of the inner `i' in this case.  */
            pop_binding (DECL_NAME (link), link);
          else if ((outer_binding
-                   && (TREE_CODE (BINDING_VALUE (outer_binding))
-                       == TYPE_DECL))
-                  || (ns_binding
-                      && TREE_CODE (ns_binding) == TYPE_DECL))
+                   && (TREE_CODE (outer_binding->value) == TYPE_DECL))
+                  || (ns_binding && TREE_CODE (ns_binding) == TYPE_DECL))
            /* Here, we have something like:
 
                 typedef int I;
            /* Here, we have something like:
 
                 typedef int I;
@@ -1284,9 +1280,8 @@ poplevel (int keep, int reverse, int functionbody)
 
              /* Keep track of what should have happened when we
                 popped the binding.  */
 
              /* Keep track of what should have happened when we
                 popped the binding.  */
-             if (outer_binding && BINDING_VALUE (outer_binding))
-               DECL_SHADOWED_FOR_VAR (link)
-                 = BINDING_VALUE (outer_binding);
+             if (outer_binding && outer_binding->value)
+               DECL_SHADOWED_FOR_VAR (link) = outer_binding->value;
 
              /* Add it to the list of dead variables in the next
                 outermost binding to that we can remove these when we
 
              /* Add it to the list of dead variables in the next
                 outermost binding to that we can remove these when we
@@ -1297,8 +1292,8 @@ poplevel (int keep, int reverse, int functionbody)
                             dead_vars_from_for);
 
              /* Although we don't pop the cxx_binding, we do clear
                             dead_vars_from_for);
 
              /* Although we don't pop the cxx_binding, we do clear
-                its BINDING_SCOPE since the level is going away now.  */
-             BINDING_SCOPE (IDENTIFIER_BINDING (DECL_NAME (link))) = 0;
+                its SCOPE since the scope is going away now.  */
+             IDENTIFIER_BINDING (DECL_NAME (link))->scope = NULL;
            }
        }
       else
            }
        }
       else
@@ -1502,12 +1497,12 @@ poplevel_class (void)
            cxx_binding *binding;
             
            binding = IDENTIFIER_BINDING (TREE_PURPOSE (shadowed));
            cxx_binding *binding;
             
            binding = IDENTIFIER_BINDING (TREE_PURPOSE (shadowed));
-           while (binding && BINDING_SCOPE (binding) != b)
+           while (binding && binding->scope != b)
              binding = binding->previous;
 
            if (binding)
              IDENTIFIER_CLASS_VALUE (TREE_PURPOSE (shadowed))
              binding = binding->previous;
 
            if (binding)
              IDENTIFIER_CLASS_VALUE (TREE_PURPOSE (shadowed))
-               = BINDING_VALUE (binding);
+               = binding->value;
          }
     }
   else
          }
     }
   else
@@ -2177,10 +2172,10 @@ set_identifier_type_value_with_scope (tree id,
        binding_for_name (NAMESPACE_LEVEL (current_namespace), id);
       if (decl)
        {
        binding_for_name (NAMESPACE_LEVEL (current_namespace), id);
       if (decl)
        {
-         if (BINDING_VALUE (binding))
+         if (binding->value)
            supplement_binding (binding, decl);
          else
            supplement_binding (binding, decl);
          else
-           BINDING_VALUE (binding) = decl;
+           binding->value = decl;
        }
       else
        abort ();
        }
       else
        abort ();
@@ -4108,9 +4103,9 @@ push_class_level_binding (tree name, tree x)
      class, then we will need to restore IDENTIFIER_CLASS_VALUE when
      we leave this class.  Record the shadowed declaration here.  */
   binding = IDENTIFIER_BINDING (name);
      class, then we will need to restore IDENTIFIER_CLASS_VALUE when
      we leave this class.  Record the shadowed declaration here.  */
   binding = IDENTIFIER_BINDING (name);
-  if (binding && BINDING_VALUE (binding))
+  if (binding && binding->value)
     {
     {
-      tree bval = BINDING_VALUE (binding);
+      tree bval = binding->value;
       tree old_decl = NULL_TREE;
 
       if (INHERITED_VALUE_BINDING_P (binding))
       tree old_decl = NULL_TREE;
 
       if (INHERITED_VALUE_BINDING_P (binding))
@@ -4122,9 +4117,9 @@ push_class_level_binding (tree name, tree x)
          if (TREE_CODE (bval) == TYPE_DECL && DECL_ARTIFICIAL (bval)
              && !(TREE_CODE (x) == TYPE_DECL && DECL_ARTIFICIAL (x)))
            {
          if (TREE_CODE (bval) == TYPE_DECL && DECL_ARTIFICIAL (bval)
              && !(TREE_CODE (x) == TYPE_DECL && DECL_ARTIFICIAL (x)))
            {
-             old_decl = BINDING_TYPE (binding);
-             BINDING_TYPE (binding) = bval;
-             BINDING_VALUE (binding) = NULL_TREE;
+             old_decl = binding->type;
+             binding->type = bval;
+             binding->value = NULL_TREE;
              INHERITED_VALUE_BINDING_P (binding) = 0;
            }
          else
              INHERITED_VALUE_BINDING_P (binding) = 0;
            }
          else
@@ -4151,7 +4146,7 @@ push_class_level_binding (tree name, tree x)
            if (TREE_PURPOSE (shadow) == name
                && TREE_TYPE (shadow) == old_decl)
              {
            if (TREE_PURPOSE (shadow) == name
                && TREE_TYPE (shadow) == old_decl)
              {
-               BINDING_VALUE (binding) = x;
+               binding->value = x;
                INHERITED_VALUE_BINDING_P (binding) = 0;
                TREE_TYPE (shadow) = x;
                IDENTIFIER_CLASS_VALUE (name) = x;
                INHERITED_VALUE_BINDING_P (binding) = 0;
                TREE_TYPE (shadow) = x;
                IDENTIFIER_CLASS_VALUE (name) = x;
@@ -4330,7 +4325,7 @@ push_overloaded_decl (tree decl, int flags)
        {
          tree *d;
 
        {
          tree *d;
 
-         for (d = &BINDING_SCOPE (IDENTIFIER_BINDING (name))->names;
+         for (d = &IDENTIFIER_BINDING (name)->scope->names;
               *d;
               d = &TREE_CHAIN (*d))
            if (*d == old
               *d;
               d = &TREE_CHAIN (*d))
            if (*d == old
@@ -4346,8 +4341,7 @@ push_overloaded_decl (tree decl, int flags)
                                  TREE_CHAIN (*d));
 
                /* And update the cxx_binding node.  */
                                  TREE_CHAIN (*d));
 
                /* And update the cxx_binding node.  */
-               BINDING_VALUE (IDENTIFIER_BINDING (name))
-                 = new_binding;
+               IDENTIFIER_BINDING (name)->value = new_binding;
                POP_TIMEVAR_AND_RETURN (TV_NAME_LOOKUP, decl);
              }
 
                POP_TIMEVAR_AND_RETURN (TV_NAME_LOOKUP, decl);
              }
 
@@ -4983,7 +4977,7 @@ follow_tag_typedef (tree type)
 
 /* Given NAME, an IDENTIFIER_NODE,
    return the structure (or union or enum) definition for that name.
 
 /* Given NAME, an IDENTIFIER_NODE,
    return the structure (or union or enum) definition for that name.
-   Searches binding levels from BINDING_SCOPE up to the global level.
+   Searches binding levels from its SCOPE up to the global level.
    If THISLEVEL_ONLY is nonzero, searches only the specified context
    (but skips any sk_cleanup contexts to find one that is
    meaningful for tags).
    If THISLEVEL_ONLY is nonzero, searches only the specified context
    (but skips any sk_cleanup contexts to find one that is
    meaningful for tags).
@@ -5027,9 +5021,9 @@ lookup_tag (enum tree_code form, tree name,
               class declaration, then we use the _TYPE node for the
               template.  See the example below.  */
            if (thislevel_only && !allow_template_parms_p
               class declaration, then we use the _TYPE node for the
               template.  See the example below.  */
            if (thislevel_only && !allow_template_parms_p
-               && binding && BINDING_VALUE (binding)
-               && DECL_CLASS_TEMPLATE_P (BINDING_VALUE (binding)))
-             old = BINDING_VALUE (binding);
+               && binding && binding->value
+               && DECL_CLASS_TEMPLATE_P (binding->value))
+             old = binding->value;
            else if (binding)
              old = select_decl (binding, LOOKUP_PREFER_TYPES);
             else
            else if (binding)
              old = select_decl (binding, LOOKUP_PREFER_TYPES);
             else
@@ -5472,7 +5466,7 @@ static tree
 select_decl (cxx_binding *binding, int flags)
 {
   tree val;
 select_decl (cxx_binding *binding, int flags)
 {
   tree val;
-  val = BINDING_VALUE (binding);
+  val = binding->value;
 
   timevar_push (TV_NAME_LOOKUP);
   if (LOOKUP_NAMESPACES_ONLY (flags))
 
   timevar_push (TV_NAME_LOOKUP);
   if (LOOKUP_NAMESPACES_ONLY (flags))
@@ -5485,9 +5479,8 @@ select_decl (cxx_binding *binding, int flags)
 
   /* If looking for a type, or if there is no non-type binding, select
      the value binding.  */
 
   /* If looking for a type, or if there is no non-type binding, select
      the value binding.  */
-  if (BINDING_TYPE (binding) 
-      && (!val || (flags & LOOKUP_PREFER_TYPES)))
-    val = BINDING_TYPE (binding);
+  if (binding->type && (!val || (flags & LOOKUP_PREFER_TYPES)))
+    val = binding->type;
   /* Don't return non-types if we really prefer types.  */
   else if (val && LOOKUP_TYPES_ONLY (flags)  && TREE_CODE (val) != TYPE_DECL
           && (TREE_CODE (val) != TEMPLATE_DECL
   /* Don't return non-types if we really prefer types.  */
   else if (val && LOOKUP_TYPES_ONLY (flags)  && TREE_CODE (val) != TYPE_DECL
           && (TREE_CODE (val) != TEMPLATE_DECL
@@ -5524,16 +5517,14 @@ unqualified_namespace_lookup (tree name, int flags, tree* spacesp)
        *spacesp = tree_cons (scope, NULL_TREE, *spacesp);
 
       /* Ignore anticipated built-in functions.  */
        *spacesp = tree_cons (scope, NULL_TREE, *spacesp);
 
       /* Ignore anticipated built-in functions.  */
-      if (b && BINDING_VALUE (b)
-          && DECL_P (BINDING_VALUE (b))
-          && DECL_LANG_SPECIFIC (BINDING_VALUE (b))
-          && DECL_ANTICIPATED (BINDING_VALUE (b)))
+      if (b && b->value && DECL_P (b->value)
+          && DECL_LANG_SPECIFIC (b->value) && DECL_ANTICIPATED (b->value))
         /* Keep binding cleared.  */;
       else if (b)
         {
           /* Initialize binding for this context.  */
         /* Keep binding cleared.  */;
       else if (b)
         {
           /* Initialize binding for this context.  */
-          binding.value = BINDING_VALUE (b);
-          binding.type = BINDING_TYPE (b);
+          binding.value = b->value;
+          binding.type = b->type;
         }
 
       /* Add all _DECLs seen through local using-directives.  */
         }
 
       /* Add all _DECLs seen through local using-directives.  */
@@ -5760,11 +5751,11 @@ lookup_name_real (tree name, int prefer_type, int nonclass,
        continue;
 
       /* If this is the kind of thing we're looking for, we're done.  */
        continue;
 
       /* If this is the kind of thing we're looking for, we're done.  */
-      if (qualify_lookup (BINDING_VALUE (iter), flags))
-       binding = BINDING_VALUE (iter);
+      if (qualify_lookup (iter->value, flags))
+       binding = iter->value;
       else if ((flags & LOOKUP_PREFER_TYPES)
       else if ((flags & LOOKUP_PREFER_TYPES)
-              && qualify_lookup (BINDING_TYPE (iter), flags))
-       binding = BINDING_TYPE (iter);
+              && qualify_lookup (iter->type, flags))
+       binding = iter->type;
       else
        binding = NULL_TREE;
 
       else
        binding = NULL_TREE;
 
@@ -5836,7 +5827,7 @@ lookup_name_current_level (tree name)
     {
       while (1)
        {
     {
       while (1)
        {
-         if (BINDING_SCOPE (IDENTIFIER_BINDING (name)) == b)
+         if (IDENTIFIER_BINDING (name)->scope == b)
            POP_TIMEVAR_AND_RETURN (TV_NAME_LOOKUP, IDENTIFIER_VALUE (name));
 
          if (b->kind == sk_cleanup)
            POP_TIMEVAR_AND_RETURN (TV_NAME_LOOKUP, IDENTIFIER_VALUE (name));
 
          if (b->kind == sk_cleanup)
@@ -7773,12 +7764,11 @@ maybe_inject_for_scope_var (tree decl)
       cxx_binding *outer_binding
        = IDENTIFIER_BINDING (DECL_NAME (decl))->previous;
 
       cxx_binding *outer_binding
        = IDENTIFIER_BINDING (DECL_NAME (decl))->previous;
 
-      if (outer_binding && BINDING_SCOPE (outer_binding) == outer
-         && (TREE_CODE (BINDING_VALUE (outer_binding)) == VAR_DECL)
-         && DECL_DEAD_FOR_LOCAL (BINDING_VALUE (outer_binding)))
+      if (outer_binding && outer_binding->scope == outer
+         && (TREE_CODE (outer_binding->value) == VAR_DECL)
+         && DECL_DEAD_FOR_LOCAL (outer_binding->value))
        {
        {
-         BINDING_VALUE (outer_binding)
-           = DECL_SHADOWED_FOR_VAR (BINDING_VALUE (outer_binding));
+         outer_binding->value = DECL_SHADOWED_FOR_VAR (outer_binding->value);
          current_binding_level->kind = sk_block;
        }
     }
          current_binding_level->kind = sk_block;
        }
     }
index b1ee970..8afd922 100644 (file)
@@ -3159,7 +3159,7 @@ ambiguous_decl (tree name, cxx_binding *old, cxx_binding *new, int flags)
   tree val, type;
   my_friendly_assert (old != NULL, 393);
   /* Copy the value.  */
   tree val, type;
   my_friendly_assert (old != NULL, 393);
   /* Copy the value.  */
-  val = BINDING_VALUE (new);
+  val = new->value;
   if (val)
     switch (TREE_CODE (val))
       {
   if (val)
     switch (TREE_CODE (val))
       {
@@ -3188,43 +3188,43 @@ ambiguous_decl (tree name, cxx_binding *old, cxx_binding *new, int flags)
           val = NULL_TREE;
       }
         
           val = NULL_TREE;
       }
         
-  if (!BINDING_VALUE (old))
-    BINDING_VALUE (old) = val;
-  else if (val && val != BINDING_VALUE (old))
+  if (!old->value)
+    old->value = val;
+  else if (val && val != old->value)
     {
     {
-      if (is_overloaded_fn (BINDING_VALUE (old)) && is_overloaded_fn (val))
-        BINDING_VALUE (old) = merge_functions (BINDING_VALUE (old), val);
+      if (is_overloaded_fn (old->value) && is_overloaded_fn (val))
+        old->value = merge_functions (old->value, val);
       else
        {
          /* Some declarations are functions, some are not.  */
           if (flags & LOOKUP_COMPLAIN)
             {
              /* If we've already given this error for this lookup,
       else
        {
          /* Some declarations are functions, some are not.  */
           if (flags & LOOKUP_COMPLAIN)
             {
              /* If we've already given this error for this lookup,
-                BINDING_VALUE (old) is error_mark_node, so let's not
+                old->value is error_mark_node, so let's not
                 repeat ourselves.  */
                 repeat ourselves.  */
-             if (BINDING_VALUE (old) != error_mark_node)
+             if (old->value != error_mark_node)
                {
                  error ("use of `%D' is ambiguous", name);
                  cp_error_at ("  first declared as `%#D' here",
                {
                  error ("use of `%D' is ambiguous", name);
                  cp_error_at ("  first declared as `%#D' here",
-                              BINDING_VALUE (old));
+                              old->value);
                }
               cp_error_at ("  also declared as `%#D' here", val);
             }
                }
               cp_error_at ("  also declared as `%#D' here", val);
             }
-         BINDING_VALUE (old) = error_mark_node;
+         old->value = error_mark_node;
        }
     }
   /* ... and copy the type.  */
        }
     }
   /* ... and copy the type.  */
-  type = BINDING_TYPE (new);
+  type = new->type;
   if (LOOKUP_NAMESPACES_ONLY (flags))
     type = NULL_TREE;
   if (LOOKUP_NAMESPACES_ONLY (flags))
     type = NULL_TREE;
-  if (!BINDING_TYPE (old))
-    BINDING_TYPE (old) = type;
-  else if (type && BINDING_TYPE (old) != type)
+  if (!old->type)
+    old->type = type;
+  else if (type && old->type != type)
     {
       if (flags & LOOKUP_COMPLAIN)
         {
           error ("`%D' denotes an ambiguous type",name);
     {
       if (flags & LOOKUP_COMPLAIN)
         {
           error ("`%D' denotes an ambiguous type",name);
-          error ("%J  first type here", TYPE_MAIN_DECL (BINDING_TYPE (old)));
+          error ("%J  first type here", TYPE_MAIN_DECL (old->type));
           error ("%J  other type here", TYPE_MAIN_DECL (type));
         }
     }
           error ("%J  other type here", TYPE_MAIN_DECL (type));
         }
     }
@@ -3258,8 +3258,7 @@ lookup_using_namespace (tree name, cxx_binding *val, tree usings, tree scope,
         if (val1)
           val = ambiguous_decl (name, val, val1, flags);
       }
         if (val1)
           val = ambiguous_decl (name, val, val1, flags);
       }
-  POP_TIMEVAR_AND_RETURN (TV_NAME_LOOKUP,
-                          BINDING_VALUE (val) != error_mark_node);
+  POP_TIMEVAR_AND_RETURN (TV_NAME_LOOKUP, val->value != error_mark_node);
 }
 
 /* [namespace.qual]
 }
 
 /* [namespace.qual]
@@ -3286,7 +3285,7 @@ qualified_lookup_using_namespace (tree name, tree scope, cxx_binding *result,
       seen = tree_cons (scope, NULL_TREE, seen);
       if (binding)
         result = ambiguous_decl (name, result, binding, flags);
       seen = tree_cons (scope, NULL_TREE, seen);
       if (binding)
         result = ambiguous_decl (name, result, binding, flags);
-      if (!BINDING_VALUE (result) && !BINDING_TYPE (result))
+      if (!result->value && !result->type)
        /* Consider using directives.  */
        for (usings = DECL_NAMESPACE_USING (scope); usings;
             usings = TREE_CHAIN (usings))
        /* Consider using directives.  */
        for (usings = DECL_NAMESPACE_USING (scope); usings;
             usings = TREE_CHAIN (usings))
@@ -3993,16 +3992,16 @@ do_toplevel_using_decl (tree decl)
   
   binding = binding_for_name (NAMESPACE_LEVEL (current_namespace), name);
 
   
   binding = binding_for_name (NAMESPACE_LEVEL (current_namespace), name);
 
-  oldval = BINDING_VALUE (binding);
-  oldtype = BINDING_TYPE (binding);
+  oldval = binding->value;
+  oldtype = binding->type;
 
   do_nonmember_using_decl (scope, name, oldval, oldtype, &newval, &newtype);
 
   /* Copy declarations found.  */
   if (newval)
 
   do_nonmember_using_decl (scope, name, oldval, oldtype, &newval, &newtype);
 
   /* Copy declarations found.  */
   if (newval)
-    BINDING_VALUE (binding) = newval;
+    binding->value = newval;
   if (newtype)
   if (newtype)
-    BINDING_TYPE (binding) = newtype;
+    binding->type = newtype;
   return;
 }
 
   return;
 }
 
index 3a16b9c..3e8e4eb 100644 (file)
@@ -336,7 +336,7 @@ supplement_binding (cxx_binding *binding, tree decl)
   else if (TREE_CODE (bval) == TYPE_DECL && DECL_ARTIFICIAL (bval))
     {
       /* The old binding was a type name.  It was placed in
   else if (TREE_CODE (bval) == TYPE_DECL && DECL_ARTIFICIAL (bval))
     {
       /* The old binding was a type name.  It was placed in
-        BINDING_VALUE because it was thought, at the point it was
+        VALUE field because it was thought, at the point it was
         declared, to be the only entity with such a name.  Move the
         type name into the type slot; it is now hidden by the new
         binding.  */
         declared, to be the only entity with such a name.  Move the
         type name into the type slot; it is now hidden by the new
         binding.  */
@@ -395,7 +395,7 @@ find_binding (cxx_scope *scope, cxx_binding *binding)
   timevar_push (TV_NAME_LOOKUP);
 
   for (; binding != NULL; binding = binding->previous)
   timevar_push (TV_NAME_LOOKUP);
 
   for (; binding != NULL; binding = binding->previous)
-    if (BINDING_SCOPE (binding) == scope)
+    if (binding->scope == scope)
       POP_TIMEVAR_AND_RETURN (TV_NAME_LOOKUP, binding);
 
   POP_TIMEVAR_AND_RETURN (TV_NAME_LOOKUP, (cxx_binding *)0);
       POP_TIMEVAR_AND_RETURN (TV_NAME_LOOKUP, binding);
 
   POP_TIMEVAR_AND_RETURN (TV_NAME_LOOKUP, (cxx_binding *)0);
@@ -409,7 +409,7 @@ cxx_scope_find_binding_for_name (cxx_scope *scope, tree name)
   if (b)
     {
       /* Fold-in case where NAME is used only once.  */
   if (b)
     {
       /* Fold-in case where NAME is used only once.  */
-      if (scope == BINDING_SCOPE (b) && b->previous == NULL)
+      if (scope == b->scope && b->previous == NULL)
         return b;
       return find_binding (scope, b);
     }
         return b;
       return find_binding (scope, b);
     }
@@ -430,7 +430,7 @@ binding_for_name (cxx_scope *scope, tree name)
   /* Not found, make a new one.  */
   result = cxx_binding_make (NULL, NULL);
   result->previous = IDENTIFIER_NAMESPACE_BINDINGS (name);
   /* Not found, make a new one.  */
   result = cxx_binding_make (NULL, NULL);
   result->previous = IDENTIFIER_NAMESPACE_BINDINGS (name);
-  BINDING_SCOPE (result) = scope;
+  result->scope = scope;
   result->is_local = false;
   result->value_is_inherited = false;
   IDENTIFIER_NAMESPACE_BINDINGS (name) = result;
   result->is_local = false;
   result->value_is_inherited = false;
   IDENTIFIER_NAMESPACE_BINDINGS (name) = result;
@@ -465,10 +465,8 @@ set_namespace_binding (tree name, tree scope, tree val)
   if (scope == NULL_TREE)
     scope = global_namespace;
   b = binding_for_name (NAMESPACE_LEVEL (scope), name);
   if (scope == NULL_TREE)
     scope = global_namespace;
   b = binding_for_name (NAMESPACE_LEVEL (scope), name);
-  if (!BINDING_VALUE (b)
-      || TREE_CODE (val) == OVERLOAD 
-      || val == error_mark_node)
-    BINDING_VALUE (b) = val;
+  if (!b->value || TREE_CODE (val) == OVERLOAD || val == error_mark_node)
+    b->value = val;
   else
     supplement_binding (b, val);
   timevar_pop (TV_NAME_LOOKUP);
   else
     supplement_binding (b, val);
   timevar_pop (TV_NAME_LOOKUP);
index 6a0917e..923f480 100644 (file)
@@ -72,22 +72,10 @@ typedef struct cp_binding_level cxx_scope;
    or namespace scope.  */
 #define LOCAL_BINDING_P(NODE) ((NODE)->is_local)
 
    or namespace scope.  */
 #define LOCAL_BINDING_P(NODE) ((NODE)->is_local)
 
-/* Nonzero if BINDING_VALUE is from a base class of the class which is
+/* True if NODE->value is from a base class of the class which is
    currently being defined.  */
 #define INHERITED_VALUE_BINDING_P(NODE) ((NODE)->value_is_inherited)
 
    currently being defined.  */
 #define INHERITED_VALUE_BINDING_P(NODE) ((NODE)->value_is_inherited)
 
-/* For a binding between a name and an entity at a non-local scope,
-   defines the scope where the binding is declared.  (Either a class
-   _TYPE node, or a NAMESPACE_DECL.).  */
-#define BINDING_SCOPE(NODE) ((NODE)->scope)
-
-/* This is the declaration bound to the name. Possible values:
-   variable, overloaded function, namespace, template, enumerator.  */
-#define BINDING_VALUE(NODE) ((NODE)->value)
-
-/* If name is bound to a type, this is the type (struct, union, enum).  */
-#define BINDING_TYPE(NODE)   ((NODE)->type)
-
 /* Zero out a cxx_binding pointed to by B.  */
 #define cxx_binding_clear(B) memset ((B), 0, sizeof (cxx_binding))
 
 /* Zero out a cxx_binding pointed to by B.  */
 #define cxx_binding_clear(B) memset ((B), 0, sizeof (cxx_binding))