aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/gcc-interface/misc.c
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@adacore.com>2016-02-16 18:01:04 +0000
committerEric Botcazou <ebotcazou@gcc.gnu.org>2016-02-16 18:01:04 +0000
commit7005800cd120168075924fe4aa254b6f80c500c7 (patch)
tree93b6a383eac0e03e24cd25a24772e2cd7d38691d /gcc/ada/gcc-interface/misc.c
parent8c7eac6260ac801715a45c8c8ffad2dd96d77bac (diff)
downloadgcc-7005800cd120168075924fe4aa254b6f80c500c7.zip
gcc-7005800cd120168075924fe4aa254b6f80c500c7.tar.gz
gcc-7005800cd120168075924fe4aa254b6f80c500c7.tar.bz2
gigi.h (maybe_debug_type): New inline function.
* gcc-interface/gigi.h (maybe_debug_type): New inline function. * gcc-interface/misc.c (gnat_get_array_descr_info): Use it. Call maybe_character_value on the array bounds. Get to the base type of the index type and call maybe_debug_type on it. * gcc-interface/utils.c (finish_character_type): Add special treatment From-SVN: r233469
Diffstat (limited to 'gcc/ada/gcc-interface/misc.c')
-rw-r--r--gcc/ada/gcc-interface/misc.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/gcc/ada/gcc-interface/misc.c b/gcc/ada/gcc-interface/misc.c
index f54e390..61a61fa 100644
--- a/gcc/ada/gcc-interface/misc.c
+++ b/gcc/ada/gcc-interface/misc.c
@@ -786,8 +786,7 @@ gnat_get_array_descr_info (const_tree const_type,
tree thinptr_bound_field = NULL_TREE;
/* ??? See gnat_get_debug_type. */
- if (TYPE_CAN_HAVE_DEBUG_TYPE_P (type) && TYPE_DEBUG_TYPE (type))
- type = TYPE_DEBUG_TYPE (type);
+ type = maybe_debug_type (type);
/* If we have an implementation type for a packed array, get the orignial
array type. */
@@ -944,8 +943,10 @@ gnat_get_array_descr_info (const_tree const_type,
}
else
{
- info->dimen[i].lower_bound = TYPE_MIN_VALUE (index_type);
- info->dimen[i].upper_bound = TYPE_MAX_VALUE (index_type);
+ info->dimen[i].lower_bound
+ = maybe_character_value (TYPE_MIN_VALUE (index_type));
+ info->dimen[i].upper_bound
+ = maybe_character_value (TYPE_MAX_VALUE (index_type));
}
}
@@ -963,13 +964,12 @@ gnat_get_array_descr_info (const_tree const_type,
thinptr_bound_field = DECL_CHAIN (thinptr_bound_field);
}
- /* The DWARF back-end will output exactly INDEX_TYPE as the array index'
- "root" type, so pell subtypes when possible. */
- while (TREE_TYPE (index_type)
- && !subrange_type_for_debug_p (index_type, NULL, NULL))
+ /* The DWARF back-end will output BOUNDS_TYPE as the base type of
+ the array index, so get to the base type of INDEX_TYPE. */
+ while (TREE_TYPE (index_type))
index_type = TREE_TYPE (index_type);
- info->dimen[i].bounds_type = index_type;
+ info->dimen[i].bounds_type = maybe_debug_type (index_type);
info->dimen[i].stride = NULL_TREE;
}