OSDN Git Service

* decl.c (record_unknown_type): New function.
authorjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 20 May 1998 19:08:59 +0000 (19:08 +0000)
committerjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 20 May 1998 19:08:59 +0000 (19:08 +0000)
(init_decl_processing): Call it for the unknown and global type
nodes.

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

gcc/cp/ChangeLog
gcc/cp/decl.c

index ef645d1..29c3ce5 100644 (file)
@@ -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.
index 0550db7..c067fe2 100644 (file)
@@ -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;