aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRichard Kenner <kenner@gcc.gnu.org>1994-02-01 11:41:57 -0500
committerRichard Kenner <kenner@gcc.gnu.org>1994-02-01 11:41:57 -0500
commit2c3dd6b7bd90e7856d2c6c89075f757528f69f02 (patch)
tree9dc7ae5cc435acca64c811550333468603263ac0 /gcc
parent8e158db406c75855a68e3317d0ea01991cf0a578 (diff)
downloadgcc-2c3dd6b7bd90e7856d2c6c89075f757528f69f02.zip
gcc-2c3dd6b7bd90e7856d2c6c89075f757528f69f02.tar.gz
gcc-2c3dd6b7bd90e7856d2c6c89075f757528f69f02.tar.bz2
(build_type_variant): Simplify by using build_type_copy.
From-SVN: r6460
Diffstat (limited to 'gcc')
-rw-r--r--gcc/tree.c16
1 files changed, 3 insertions, 13 deletions
diff --git a/gcc/tree.c b/gcc/tree.c
index 2e4bb12..9bf9cfd 100644
--- a/gcc/tree.c
+++ b/gcc/tree.c
@@ -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;
}