]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
cp-tree.h (struct tree_binding): Replace scope field with a union.
authorJason Merrill <jason@yorick.cygnus.com>
Thu, 28 Jan 1999 09:47:48 +0000 (09:47 +0000)
committerJason Merrill <jason@gcc.gnu.org>
Thu, 28 Jan 1999 09:47:48 +0000 (04:47 -0500)
* cp-tree.h (struct tree_binding): Replace scope field with a union.
(BINDING_SCOPE): Adjust.
* decl.c (BINDING_LEVEL): Adjust.

From-SVN: r24894

gcc/cp/ChangeLog
gcc/cp/cp-tree.h
gcc/cp/decl.c

index 7342161b75b9dad81ecb2162ec1580c5394415fc..d1154ef77625f03306cae14a5b32a96edcfc5ffd 100644 (file)
@@ -1,3 +1,9 @@
+1999-01-28  Jason Merrill  <jason@yorick.cygnus.com>
+
+       * cp-tree.h (struct tree_binding): Replace scope field with a union.
+       (BINDING_SCOPE): Adjust.
+       * decl.c (BINDING_LEVEL): Adjust.
+
 1999-01-26  Jason Merrill  <jason@yorick.cygnus.com>
 
        * pt.c (instantiate_class_template): Set up the DECL_INITIAL of
index 534fadc06087c68b6888c602de9a2bc519e9d29a..0471be4f8078cf165cf740c4aa62535809b5820e 100644 (file)
@@ -138,7 +138,7 @@ typedef struct ptrmem_cst
    _TYPE node, or a NAMESPACE_DECL.)  This macro should be used only
    for namespace-level bindings; on the IDENTIFIER_BINDING list
    BINDING_LEVEL is used instead.  */
-#define BINDING_SCOPE(NODE) ((tree) ((struct tree_binding*)NODE)->scope)
+#define BINDING_SCOPE(NODE) (((struct tree_binding*)NODE)->scope.scope)
 
 /* This is the declaration bound to the name. Possible values:
    variable, overloaded function, namespace, template, enumerator.  */
@@ -159,7 +159,10 @@ typedef struct ptrmem_cst
 struct tree_binding
 {
   char common[sizeof (struct tree_common)];
-  void* scope;
+  union {
+    tree scope;
+    struct binding_level *level;
+  } scope;
   tree value;
 };
 
index 401158192879d765b251c9de1fde18b7493df393..95b16d29abee394b697543523a4a58b5513b09a9 100644 (file)
@@ -1039,7 +1039,7 @@ pushlevel_temporary (tag_transparent)
 /* For a binding between a name and an entity at a block scope,
    this is the `struct binding_level' for the block.  */
 #define BINDING_LEVEL(NODE) \
-   ((struct binding_level*) ((struct tree_binding*)NODE)->scope)
+   (((struct tree_binding*)NODE)->scope.level)
 
 /* These are currently unused, but permanent, CPLUS_BINDING nodes.
    They are kept here because they are allocated from the permanent