diff options
| author | Richard Kenner <kenner@gnat.com> | 2001-10-26 16:01:07 +0000 |
|---|---|---|
| committer | Geert Bosch <bosch@gcc.gnu.org> | 2001-10-26 18:01:07 +0200 |
| commit | 7a3a8c068bfe942e28089b7a07a32690edad14ea (patch) | |
| tree | ed4707cd5dcbe013280768918cb414abc1be1092 /gcc/ada/utils.c | |
| parent | b403bd177c82c7ec36f72c07caa0f08bf5a49d93 (diff) | |
| download | gcc-7a3a8c068bfe942e28089b7a07a32690edad14ea.zip gcc-7a3a8c068bfe942e28089b7a07a32690edad14ea.tar.gz gcc-7a3a8c068bfe942e28089b7a07a32690edad14ea.tar.bz2 | |
decl.c (gnat_to_gnu_entity, [...]): Make constant variant of designated type for Is_Access_Constant.
* 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.
From-SVN: r46547
Diffstat (limited to 'gcc/ada/utils.c')
| -rw-r--r-- | gcc/ada/utils.c | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/gcc/ada/utils.c b/gcc/ada/utils.c index b23bbe9..42892e5 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. */ |
