DWARF: describe properly Ada packed arrays
authorpmderodat <pmderodat@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 17 Dec 2015 14:10:32 +0000 (14:10 +0000)
committerpmderodat <pmderodat@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 17 Dec 2015 14:10:32 +0000 (14:10 +0000)
commit91f0977185faea28770729b305c825fdc3f2116a
tree5c7367eb96eaa74caac0e65ec96a0af93b99340e
parente0501e5ff8e317a259967c6e87f11357fd65c6d4
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.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@231768 138bc75d-0d04-0410-961f-82ee72b054a4
gcc/ada/ChangeLog
gcc/ada/gcc-interface/ada-tree.h
gcc/ada/gcc-interface/decl.c
gcc/ada/gcc-interface/misc.c
gcc/ada/gcc-interface/utils.c