aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/cp')
-rw-r--r--gcc/cp/ChangeLog11
-rw-r--r--gcc/cp/cp-lang.c5
-rw-r--r--gcc/cp/cp-tree.def4
-rw-r--r--gcc/cp/decl2.c13
-rw-r--r--gcc/cp/error.c1
-rw-r--r--gcc/cp/name-lookup.c1
-rw-r--r--gcc/cp/semantics.c5
7 files changed, 18 insertions, 22 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index ae12c20..7aa392f 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,14 @@
+2005-09-09 Richard Henderson <rth@redhat.com>
+
+ PR debug/20998
+ * cp-tree.def (ALIAS_DECL): Remove.
+ * cp-lang.c (cp_init_ts): Remove support for it.
+ * error.c (dump_decl): Likewise.
+ * name-lookup.c (pushdecl): Likewise.
+ * semantics.c (finish_id_expression): Likewise.
+ * decl2.c (build_anon_union_vars): Use a VAR_DECL with
+ DECL_VALUE_EXPR instead.
+
2005-09-09 Mark Mitchell <mark@codesourcery.com>
PR c++/22252
diff --git a/gcc/cp/cp-lang.c b/gcc/cp/cp-lang.c
index c79486a..38e2e5a 100644
--- a/gcc/cp/cp-lang.c
+++ b/gcc/cp/cp-lang.c
@@ -117,27 +117,22 @@ cp_init_ts (void)
tree_contains_struct[NAMESPACE_DECL][TS_DECL_NON_COMMON] = 1;
tree_contains_struct[USING_DECL][TS_DECL_NON_COMMON] = 1;
tree_contains_struct[TEMPLATE_DECL][TS_DECL_NON_COMMON] = 1;
- tree_contains_struct[ALIAS_DECL][TS_DECL_NON_COMMON] = 1;
tree_contains_struct[NAMESPACE_DECL][TS_DECL_WITH_VIS] = 1;
tree_contains_struct[USING_DECL][TS_DECL_WITH_VIS] = 1;
tree_contains_struct[TEMPLATE_DECL][TS_DECL_WITH_VIS] = 1;
- tree_contains_struct[ALIAS_DECL][TS_DECL_WITH_VIS] = 1;
tree_contains_struct[NAMESPACE_DECL][TS_DECL_WRTL] = 1;
tree_contains_struct[USING_DECL][TS_DECL_WRTL] = 1;
tree_contains_struct[TEMPLATE_DECL][TS_DECL_WRTL] = 1;
- tree_contains_struct[ALIAS_DECL][TS_DECL_WRTL] = 1;
tree_contains_struct[NAMESPACE_DECL][TS_DECL_COMMON] = 1;
tree_contains_struct[USING_DECL][TS_DECL_COMMON] = 1;
tree_contains_struct[TEMPLATE_DECL][TS_DECL_COMMON] = 1;
- tree_contains_struct[ALIAS_DECL][TS_DECL_COMMON] = 1;
tree_contains_struct[NAMESPACE_DECL][TS_DECL_MINIMAL] = 1;
tree_contains_struct[USING_DECL][TS_DECL_MINIMAL] = 1;
tree_contains_struct[TEMPLATE_DECL][TS_DECL_MINIMAL] = 1;
- tree_contains_struct[ALIAS_DECL][TS_DECL_MINIMAL] = 1;
init_shadowed_var_for_decl ();
diff --git a/gcc/cp/cp-tree.def b/gcc/cp/cp-tree.def
index 7f0c1fc..096d00a 100644
--- a/gcc/cp/cp-tree.def
+++ b/gcc/cp/cp-tree.def
@@ -87,10 +87,6 @@ DEFTREECODE (THROW_EXPR, "throw_expr", tcc_expression, 1)
these to avoid actually creating instances of the empty classes. */
DEFTREECODE (EMPTY_CLASS_EXPR, "empty_class_expr", tcc_expression, 0)
-/* A DECL which is really just a placeholder for an expression. Used to
- implement non-class scope anonymous unions. */
-DEFTREECODE (ALIAS_DECL, "alias_decl", tcc_declaration, 0)
-
/* A reference to a member function or member functions from a base
class. BASELINK_FUNCTIONS gives the FUNCTION_DECL,
TEMPLATE_DECL, OVERLOAD, or TEMPLATE_ID_EXPR corresponding to the
diff --git a/gcc/cp/decl2.c b/gcc/cp/decl2.c
index 8a7d7d6..8ef6fa8 100644
--- a/gcc/cp/decl2.c
+++ b/gcc/cp/decl2.c
@@ -1057,7 +1057,7 @@ cplus_decl_attributes (tree *decl, tree attributes, int flags)
}
/* Walks through the namespace- or function-scope anonymous union
- OBJECT, with the indicated TYPE, building appropriate ALIAS_DECLs.
+ OBJECT, with the indicated TYPE, building appropriate VAR_DECLs.
Returns one of the fields for use in the mangled name. */
static tree
@@ -1101,11 +1101,12 @@ build_anon_union_vars (tree type, tree object)
if (DECL_NAME (field))
{
- decl = build_decl (ALIAS_DECL, DECL_NAME (field), TREE_TYPE (field));
- DECL_INITIAL (decl) = ref;
- TREE_PUBLIC (decl) = 0;
- TREE_STATIC (decl) = 0;
- DECL_EXTERNAL (decl) = 1;
+ decl = build_decl (VAR_DECL, DECL_NAME (field), TREE_TYPE (field));
+ TREE_PUBLIC (decl) = TREE_PUBLIC (object);
+ TREE_STATIC (decl) = TREE_PUBLIC (object);
+ DECL_EXTERNAL (decl) = DECL_EXTERNAL (object);
+ SET_DECL_VALUE_EXPR (decl, ref);
+ DECL_HAS_VALUE_EXPR_P (decl) = 1;
decl = pushdecl (decl);
}
else if (ANON_AGGR_TYPE_P (TREE_TYPE (field)))
diff --git a/gcc/cp/error.c b/gcc/cp/error.c
index 9905e25..1220119 100644
--- a/gcc/cp/error.c
+++ b/gcc/cp/error.c
@@ -744,7 +744,6 @@ dump_decl (tree t, int flags)
/* Else fall through. */
case FIELD_DECL:
case PARM_DECL:
- case ALIAS_DECL:
dump_simple_decl (t, TREE_TYPE (t), flags);
break;
diff --git a/gcc/cp/name-lookup.c b/gcc/cp/name-lookup.c
index f936a86..cba9393 100644
--- a/gcc/cp/name-lookup.c
+++ b/gcc/cp/name-lookup.c
@@ -831,7 +831,6 @@ pushdecl (tree x)
&& t != NULL_TREE)
&& (TREE_CODE (x) == TYPE_DECL
|| TREE_CODE (x) == VAR_DECL
- || TREE_CODE (x) == ALIAS_DECL
|| TREE_CODE (x) == NAMESPACE_DECL
|| TREE_CODE (x) == CONST_DECL
|| TREE_CODE (x) == TEMPLATE_DECL))
diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c
index 3691457..0e926bf 100644
--- a/gcc/cp/semantics.c
+++ b/gcc/cp/semantics.c
@@ -2747,11 +2747,6 @@ finish_id_expression (tree id_expression,
decl = convert_from_reference (decl);
}
-
- /* Resolve references to variables of anonymous unions
- into COMPONENT_REFs. */
- if (TREE_CODE (decl) == ALIAS_DECL)
- decl = unshare_expr (DECL_INITIAL (decl));
}
if (TREE_DEPRECATED (decl))