diff options
author | Eric Botcazou <ebotcazou@gcc.gnu.org> | 2020-05-25 09:41:08 +0200 |
---|---|---|
committer | Eric Botcazou <ebotcazou@gcc.gnu.org> | 2020-05-25 09:44:55 +0200 |
commit | a27aceb98a1178297cefb6eabe24d8a2ea4b72cd (patch) | |
tree | 4535e71ff85ae22254a4aa72f9076fca0236f2a5 /gcc/ada/gcc-interface/utils.c | |
parent | 49d6f7243ae7f8e7d8ed162776847fae47c3f218 (diff) | |
download | gcc-a27aceb98a1178297cefb6eabe24d8a2ea4b72cd.zip gcc-a27aceb98a1178297cefb6eabe24d8a2ea4b72cd.tar.gz gcc-a27aceb98a1178297cefb6eabe24d8a2ea4b72cd.tar.bz2 |
Change description of fat pointertype with -fgnat-encodings=minimal
This makes a step back in the representation of fat pointer types in
the debug info with -fgnat-encodings=minimal so as to avoid hiding the
data indirection and making it easiser to synthetize the construct.
gcc/ada/ChangeLog
* gcc-interface/decl.c (gnat_to_gnu_entity) <E_Array_Type>: Add a
description of the various types associated with the unconstrained
type. Declare the fat pointer earlier. Set the current function
as context on the template type, and the fat pointer type on the
array type. Always mark the fat pointer type as artificial and set
it as the context for the pointer type to the array. Also reuse
GNU_ENTITY_NAME. Finish up the unconstrained type at the very end.
* gcc-interface/misc.c (gnat_get_array_descr_info): Do not handle
fat pointer types and tidy up accordingly.
* gcc-interface/utils.c (build_unc_object_type): Do not set the
context on the template type.
Diffstat (limited to 'gcc/ada/gcc-interface/utils.c')
-rw-r--r-- | gcc/ada/gcc-interface/utils.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/gcc/ada/gcc-interface/utils.c b/gcc/ada/gcc-interface/utils.c index 1527be4..fb08b6c 100644 --- a/gcc/ada/gcc-interface/utils.c +++ b/gcc/ada/gcc-interface/utils.c @@ -891,6 +891,9 @@ gnat_pushdecl (tree decl, Node_Id gnat_node) their GNAT encodings. */ if (TREE_CODE (t) == ARRAY_TYPE && !TYPE_NAME (t)) TYPE_NAME (t) = DECL_NAME (decl); + /* Remark the canonical fat pointer type as artificial. */ + if (TYPE_IS_FAT_POINTER_P (t)) + TYPE_ARTIFICIAL (t) = 1; t = NULL_TREE; } else if (TYPE_NAME (t) @@ -4167,7 +4170,6 @@ tree build_unc_object_type (tree template_type, tree object_type, tree name, bool debug_info_p) { - tree decl; tree type = make_node (RECORD_TYPE); tree template_field = create_field_decl (get_identifier ("BOUNDS"), template_type, type, @@ -4183,12 +4185,7 @@ build_unc_object_type (tree template_type, tree object_type, tree name, /* Declare it now since it will never be declared otherwise. This is necessary to ensure that its subtrees are properly marked. */ - decl = create_type_decl (name, type, true, debug_info_p, Empty); - - /* template_type will not be used elsewhere than here, so to keep the debug - info clean and in order to avoid scoping issues, make decl its - context. */ - gnat_set_type_context (template_type, decl); + create_type_decl (name, type, true, debug_info_p, Empty); return type; } |