aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorMartin v. Löwis <loewis@informatik.hu-berlin.de>1998-05-20 15:08:59 -0400
committerJason Merrill <jason@gcc.gnu.org>1998-05-20 15:08:59 -0400
commit036407f7b38207f934c62f65a0a732c356f9a98e (patch)
treeb265b35874cb2bc8b68c02b69a2adec9fbb83d86 /gcc
parent4e5a8d7b868a22aeb18f68fc15198943a165ada5 (diff)
downloadgcc-036407f7b38207f934c62f65a0a732c356f9a98e.zip
gcc-036407f7b38207f934c62f65a0a732c356f9a98e.tar.gz
gcc-036407f7b38207f934c62f65a0a732c356f9a98e.tar.bz2
decl.c (record_unknown_type): New function.
* decl.c (record_unknown_type): New function. (init_decl_processing): Call it for the unknown and global type nodes. From-SVN: r19912
Diffstat (limited to 'gcc')
-rw-r--r--gcc/cp/ChangeLog6
-rw-r--r--gcc/cp/decl.c29
2 files changed, 26 insertions, 9 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index ef645d1..29c3ce5 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,9 @@
+1998-05-20 Martin von Loewis <loewis@informatik.hu-berlin.de>
+
+ * decl.c (record_unknown_type): New function.
+ (init_decl_processing): Call it for the unknown and global type
+ nodes.
+
1998-05-20 Mark Mitchell <mmitchell@usa.net>
* decl2.c (find_representative_member): New function.
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c
index 0550db7..c067fe2 100644
--- a/gcc/cp/decl.c
+++ b/gcc/cp/decl.c
@@ -168,6 +168,7 @@ static tree lookup_tag PROTO((enum tree_code, tree,
static void set_identifier_type_value_with_scope
PROTO((tree, tree, struct binding_level *));
static void record_builtin_type PROTO((enum rid, char *, tree));
+static void record_unknown_type PROTO((tree, char *));
static int member_function_or_else PROTO((tree, tree, char *));
static void bad_specifiers PROTO((tree, char *, int, int, int, int,
int));
@@ -5102,6 +5103,22 @@ record_builtin_type (rid_index, name, type)
}
}
+/* Push a type into the namespace so that the back-ends ignore it. */
+
+static void
+record_unknown_type (type, name)
+ tree type;
+ char *name;
+{
+ tree decl = pushdecl (build_decl (TYPE_DECL, get_identifier (name), type));
+ /* Make sure the "unknown type" typedecl gets ignored for debug info. */
+ DECL_IGNORED_P (decl) = 1;
+ TYPE_DECL_SUPPRESS_DEBUG (decl) = 1;
+ TYPE_SIZE (type) = TYPE_SIZE (void_type_node);
+ TYPE_ALIGN (type) = 1;
+ TYPE_MODE (type) = TYPE_MODE (void_type_node);
+}
+
/* Push overloaded decl, in global scope, with one argument so it
can be used as a callback from define_function. */
@@ -5697,14 +5714,8 @@ init_decl_processing ()
/* C++ extensions */
unknown_type_node = make_node (UNKNOWN_TYPE);
- decl = pushdecl (build_decl (TYPE_DECL, get_identifier ("unknown type"),
- unknown_type_node));
- /* Make sure the "unknown type" typedecl gets ignored for debug info. */
- DECL_IGNORED_P (decl) = 1;
- TYPE_DECL_SUPPRESS_DEBUG (decl) = 1;
- TYPE_SIZE (unknown_type_node) = TYPE_SIZE (void_type_node);
- TYPE_ALIGN (unknown_type_node) = 1;
- TYPE_MODE (unknown_type_node) = TYPE_MODE (void_type_node);
+ record_unknown_type (unknown_type_node, "unknown type");
+
/* Indirecting an UNKNOWN_TYPE node yields an UNKNOWN_TYPE node. */
TREE_TYPE (unknown_type_node) = unknown_type_node;
@@ -5828,7 +5839,7 @@ init_decl_processing ()
pushdecl (std_node);
global_type_node = make_node (LANG_TYPE);
- record_builtin_type (RID_MAX, "global type", global_type_node);
+ record_unknown_type (global_type_node, "global type");
/* Now, C++. */
current_lang_name = lang_name_cplusplus;