aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJason Merrill <jason@yorick.cygnus.com>1999-01-28 09:47:48 +0000
committerJason Merrill <jason@gcc.gnu.org>1999-01-28 04:47:48 -0500
commitc7a932b1cff62ab30552ce88caf48272243f108e (patch)
tree89ab4ee01fa8c681348331c5294486d66cf3e8cc /gcc
parent661c7909597d5da70b9c428247bcf451b95a3557 (diff)
downloadgcc-c7a932b1cff62ab30552ce88caf48272243f108e.zip
gcc-c7a932b1cff62ab30552ce88caf48272243f108e.tar.gz
gcc-c7a932b1cff62ab30552ce88caf48272243f108e.tar.bz2
cp-tree.h (struct tree_binding): Replace scope field with a union.
* cp-tree.h (struct tree_binding): Replace scope field with a union. (BINDING_SCOPE): Adjust. * decl.c (BINDING_LEVEL): Adjust. From-SVN: r24894
Diffstat (limited to 'gcc')
-rw-r--r--gcc/cp/ChangeLog6
-rw-r--r--gcc/cp/cp-tree.h7
-rw-r--r--gcc/cp/decl.c2
3 files changed, 12 insertions, 3 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 7342161..d1154ef 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -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
diff --git a/gcc/cp/cp-tree.h b/gcc/cp/cp-tree.h
index 534fadc..0471be4 100644
--- a/gcc/cp/cp-tree.h
+++ b/gcc/cp/cp-tree.h
@@ -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;
};
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c
index 4011581..95b16d2 100644
--- a/gcc/cp/decl.c
+++ b/gcc/cp/decl.c
@@ -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