OSDN Git Service

(next_type_uid): Move definition to reasonable place. (copy_node):
authorkenner <kenner@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 31 Mar 1993 21:03:25 +0000 (21:03 +0000)
committerkenner <kenner@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 31 Mar 1993 21:03:25 +0000 (21:03 +0000)
Make new DECL_UID and TYPE_UID as comments say.

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

gcc/tree.c

index 0ce3ddb..7f13a3e 100644 (file)
@@ -245,6 +245,8 @@ static int do_identifier_warnings;
 
 /* Unique id for next decl created.  */
 static int next_decl_uid;
+/* Unique id for next type created.  */
+static int next_type_uid = 1;
 
 extern char *mode_name[];
 
@@ -908,11 +910,7 @@ make_node (code)
       break;
 
     case 't':
-      {
-       static unsigned next_type_uid = 1;
-
-       TYPE_UID (t) = next_type_uid++;
-      }
+      TYPE_UID (t) = next_type_uid++;
       TYPE_ALIGN (t) = 1;
       TYPE_MAIN_VARIANT (t) = t;
       break;
@@ -987,6 +985,11 @@ copy_node (node)
 
   TREE_CHAIN (t) = 0;
 
+  if (TREE_CODE_CLASS (code) == 'd')
+    DECL_UID (t) = next_decl_uid++;
+  else if (TREE_CODE_CLASS (code) == 't')
+    TYPE_UID (t) = next_type_uid++;
+
   TREE_PERMANENT (t) = (current_obstack == &permanent_obstack);
 
   return t;