diff options
author | Pierre-Marie de Rodat <derodat@adacore.com> | 2015-12-17 14:10:32 +0000 |
---|---|---|
committer | Pierre-Marie de Rodat <pmderodat@gcc.gnu.org> | 2015-12-17 14:10:32 +0000 |
commit | 2d5958875d2df15d6d04a3371dd6b54ec14a4e53 (patch) | |
tree | 5c7367eb96eaa74caac0e65ec96a0af93b99340e /gcc/ada/gcc-interface/utils.c | |
parent | 69c5f9d7b57c82797154bdc199e69326ac981101 (diff) | |
download | gcc-2d5958875d2df15d6d04a3371dd6b54ec14a4e53.zip gcc-2d5958875d2df15d6d04a3371dd6b54ec14a4e53.tar.gz gcc-2d5958875d2df15d6d04a3371dd6b54ec14a4e53.tar.bz2 |
DWARF: describe properly Ada packed arrays
gcc/ada/ChangeLog:
* gcc-interface/ada-tree.h
(TYPE_IMPLEMENTS_PACKED_ARRAY_P, TYPE_CAN_HAVE_DEBUG_TYPE_P,
TYPE_ORIGINAL_PACKED_ARRAY, SET_TYPE_ORIGINAL_PACKED_ARRAY): New
macros.
* gcc-interface/decl.c (add_parallel_type_for_packed_array):
Rename to associate_original_type_to_packed_array. When
-fgnat-encodings=minimal, set original packed array type as so
instead of as a parallel type to the implementation type. In
this case, also rename the implementation type to the name of
the original array type.
(gnat_to_gnu_entity): Update invocations to
add_parallel_type_for_packed_array. Tag ARRAY_TYPE nodes for
packed arrays with the TYPE_PACKED flag.
When -fgnat-encodings=minimal:
- strip ___XP suffixes in packed arrays' names;
- set the debug type for padding records around packed arrays
to the packed array;
- do not attach ___XUP types as parallel types of constrained
array types.
* gcc-interface/misc.c (gnat_print_type): Update to handle
orignal packed arrays.
(gnat_get_debug_type): Update to reject packed arrays
implementation types.
(get_array_bit_stride): New.
(gnat_get_array_descr_info): Add packed arrays handling.
* gcc-interface/utils.c (maybe_pad_type): When
-fgnat-encodings=minimal, set the name of the padding type to
the one of the original packed type, if any. Fix TYPE_DECL
peeling around the name of the input type.
From-SVN: r231768
Diffstat (limited to 'gcc/ada/gcc-interface/utils.c')
-rw-r--r-- | gcc/ada/gcc-interface/utils.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/gcc/ada/gcc-interface/utils.c b/gcc/ada/gcc-interface/utils.c index 1816f3a..be3565a 100644 --- a/gcc/ada/gcc-interface/utils.c +++ b/gcc/ada/gcc-interface/utils.c @@ -1281,7 +1281,17 @@ maybe_pad_type (tree type, tree size, unsigned int align, if (gnat_encodings == DWARF_GNAT_ENCODINGS_MINIMAL) SET_TYPE_DEBUG_TYPE (record, type); - if (Present (gnat_entity)) + /* ??? Kludge: padding types around packed array implementation types will be + considered as root types in the array descriptor language hook (see + gnat_get_array_descr_info). Give them the original packed array type + name so that the one coming from sources appears in the debugging + information. */ + if (gnat_encodings == DWARF_GNAT_ENCODINGS_MINIMAL + && TYPE_IMPLEMENTS_PACKED_ARRAY_P (type) + && TYPE_ORIGINAL_PACKED_ARRAY (type) != NULL_TREE) + TYPE_NAME (record) + = TYPE_NAME (TYPE_ORIGINAL_PACKED_ARRAY (type)); + else if (Present (gnat_entity)) TYPE_NAME (record) = create_concat_name (gnat_entity, "PAD"); TYPE_ALIGN (record) = align ? align : orig_align; |