summaryrefslogtreecommitdiff
path: root/gcc/ada/utils.c
diff options
context:
space:
mode:
authorbosch <bosch@138bc75d-0d04-0410-961f-82ee72b054a4>2001-10-26 16:01:07 +0000
committerbosch <bosch@138bc75d-0d04-0410-961f-82ee72b054a4>2001-10-26 16:01:07 +0000
commitff540fb068b6274bd0b1c88cccf01b1cfdd19ef6 (patch)
treeed4707cd5dcbe013280768918cb414abc1be1092 /gcc/ada/utils.c
parentb238a680662674f2e66b553b385cab0f493116f2 (diff)
downloadgcc-ff540fb068b6274bd0b1c88cccf01b1cfdd19ef6.tar.gz
* decl.c (gnat_to_gnu_entity, case E_General_Access_Type):
Make constant variant of designated type for Is_Access_Constant. Call update_pointer_to with main variant. * trans.c (process_freeze_entity, process_type): Call update_pointer_to on main variant. * utils.c (update_pointer_to): Make corresponding variant for NEW_TYPE. If main variant, update all other variants. * utils2.c (build_unary_op, case INDIRECT_REF): No longer set TREE_STATIC. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@46547 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/utils.c')
-rw-r--r--gcc/ada/utils.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/gcc/ada/utils.c b/gcc/ada/utils.c
index b23bbe9f0c6..42892e59727 100644
--- a/gcc/ada/utils.c
+++ b/gcc/ada/utils.c
@@ -6,7 +6,7 @@
* *
* C Implementation File *
* *
- * $Revision: 1.4 $
+ * $Revision$
* *
* Copyright (C) 1992-2001, Free Software Foundation, Inc. *
* *
@@ -2581,8 +2581,22 @@ update_pointer_to (old_type, new_type)
{
tree ptr = TYPE_POINTER_TO (old_type);
tree ref = TYPE_REFERENCE_TO (old_type);
+ tree type;
+
+ /* If this is the main variant, process all the other variants first. */
+ if (TYPE_MAIN_VARIANT (old_type) == old_type)
+ for (type = TYPE_NEXT_VARIANT (old_type); type != 0;
+ type = TYPE_NEXT_VARIANT (type))
+ update_pointer_to (type, new_type);
+
+ /* If no pointer or reference, we are done. Otherwise, get the new type with
+ the same qualifiers as the old type and see if it is the same as the old
+ type. */
+ if (ptr == 0 && ref == 0)
+ return;
- if ((ptr == 0 && ref == 0) || old_type == new_type)
+ new_type = build_qualified_type (new_type, TYPE_QUALS (old_type));
+ if (old_type == new_type)
return;
/* First handle the simple case. */