]> gcc.gnu.org Git - gcc.git/commitdiff
(build_type_variant): Simplify by using build_type_copy.
authorRichard Kenner <kenner@gcc.gnu.org>
Tue, 1 Feb 1994 16:41:57 +0000 (11:41 -0500)
committerRichard Kenner <kenner@gcc.gnu.org>
Tue, 1 Feb 1994 16:41:57 +0000 (11:41 -0500)
From-SVN: r6460

gcc/tree.c

index 2e4bb129d73afcde615e0e92657d4ce6ae1de933..9bf9cfd53780c9be4fa9bc2d1978cfb02ead9eb8 100644 (file)
@@ -2637,8 +2637,7 @@ build_type_variant (type, constp, volatilep)
      tree type;
      int constp, volatilep;
 {
-  register tree t, m = TYPE_MAIN_VARIANT (type);
-  register struct obstack *ambient_obstack = current_obstack;
+  register tree t;
 
   /* Treat any nonzero argument as 1.  */
   constp = !!constp;
@@ -2654,24 +2653,15 @@ build_type_variant (type, constp, volatilep)
      (existing) type.  */
 
   if (!flag_gen_aux_info)
-    for (t = m; t; t = TYPE_NEXT_VARIANT (t))
+    for (t = TYPE_MAIN_VARIANT(type); t; t = TYPE_NEXT_VARIANT (t))
       if (constp == TYPE_READONLY (t) && volatilep == TYPE_VOLATILE (t))
         return t;
 
   /* We need a new one.  */
 
-  current_obstack = TYPE_OBSTACK (type);
-  t = copy_node (type);
-  current_obstack = ambient_obstack;
-
+  t = build_type_copy (type);
   TYPE_READONLY (t) = constp;
   TYPE_VOLATILE (t) = volatilep;
-  TYPE_POINTER_TO (t) = 0;
-  TYPE_REFERENCE_TO (t) = 0;
-
-  /* Add this type to the chain of variants of TYPE.  */
-  TYPE_NEXT_VARIANT (t) = TYPE_NEXT_VARIANT (m);
-  TYPE_NEXT_VARIANT (m) = t;
 
   return t;
 }
This page took 0.06623 seconds and 5 git commands to generate.