diff options
author | Eric Botcazou <ebotcazou@adacore.com> | 2020-11-19 11:04:52 +0100 |
---|---|---|
committer | Eric Botcazou <ebotcazou@adacore.com> | 2020-11-19 11:04:52 +0100 |
commit | 43a0debd527b75eb564cad6bd47f5d5bb301dfad (patch) | |
tree | da21597c3e40f05e45153c7ba9c0bedfb42495d1 /gcc/dwarf2out.c | |
parent | 0d8290959ecf2c5f1dd062e57782b5e91be0f8f6 (diff) | |
download | gcc-43a0debd527b75eb564cad6bd47f5d5bb301dfad.zip gcc-43a0debd527b75eb564cad6bd47f5d5bb301dfad.tar.gz gcc-43a0debd527b75eb564cad6bd47f5d5bb301dfad.tar.bz2 |
Enhance debug info for fixed-point types
The Ada language supports fixed-point types as first-class citizens so
they need to be described as-is in the debug info. We devised the
langhook get_fixed_point_type_info for this purpose a few years ago,
but it comes with a limitation for the representation of the scale
factor that we would need to lift in order to be able to represent
more fixed-point types.
gcc/ChangeLog:
* dwarf2out.h (struct fixed_point_type_info) <scale_factor>: Turn
numerator and denominator into a tree.
* dwarf2out.c (base_type_die): In the case of a fixed-point type
with arbitrary scale factor, call add_scalar_info on numerator and
denominator to emit the appropriate attributes.
gcc/ada/ChangeLog:
* exp_dbug.adb (Is_Handled_Scale_Factor): Delete.
(Get_Encoded_Name): Do not call it.
* gcc-interface/decl.c (gnat_to_gnu_entity) <Fixed_Point_Type>:
Tidy up and always use a meaningful description for arbitrary
scale factors.
* gcc-interface/misc.c (gnat_get_fixed_point_type_info): Remove
obsolete block and adjust the description of the scale factor.
Diffstat (limited to 'gcc/dwarf2out.c')
-rw-r--r-- | gcc/dwarf2out.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c index 54eb445..ea2a22a 100644 --- a/gcc/dwarf2out.c +++ b/gcc/dwarf2out.c @@ -12973,18 +12973,19 @@ base_type_die (tree type, bool reverse) break; case fixed_point_scale_factor_arbitrary: - /* Arbitrary scale factors cannot be described in standard DWARF, - yet. */ + /* Arbitrary scale factors cannot be described in standard DWARF. */ if (!dwarf_strict) { /* Describe the scale factor as a rational constant. */ const dw_die_ref scale_factor = new_die (DW_TAG_constant, comp_unit_die (), type); - add_AT_unsigned (scale_factor, DW_AT_GNU_numerator, - fpt_info.scale_factor.arbitrary.numerator); - add_AT_int (scale_factor, DW_AT_GNU_denominator, - fpt_info.scale_factor.arbitrary.denominator); + add_scalar_info (scale_factor, DW_AT_GNU_numerator, + fpt_info.scale_factor.arbitrary.numerator, + dw_scalar_form_constant, NULL); + add_scalar_info (scale_factor, DW_AT_GNU_denominator, + fpt_info.scale_factor.arbitrary.denominator, + dw_scalar_form_constant, NULL); add_AT_die_ref (base_type_result, DW_AT_small, scale_factor); } |