]> git.ipfire.org Git - thirdparty/gcc.git/commit
DWARF: add a language hook for fixed-point types
authorpmderodat <pmderodat@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 17 Dec 2015 14:09:55 +0000 (14:09 +0000)
committerpmderodat <pmderodat@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 17 Dec 2015 14:09:55 +0000 (14:09 +0000)
commit6a3b696e4b5c2bab12194220bad8c1316467568e
tree95d7a868396094336050add983f43966dd2afabf
parentdb3c183a4446aaf27626517ed6ba6042e233a3f1
DWARF: add a language hook for fixed-point types

Support for fixed-point types in GCC is not powerful enough for Ada
fixed-point types: GNAT uses regular scalar types to implement them.
This new language hook makes it possible to output the desired debugging
information anyway.

gcc/ada/ChangeLog:

* gcc-interface/ada-tree.def (POWER_EXPR): New binary operation.
* gcc-interface/ada-tree.h (TYPE_FIXED_POINT_P): New macro.
(TYPE_IS_FIXED_POINT_P): New macro.
(TYPE_SCALE_FACTOR): New macro.
(SET_TYPE_SCALE_FACTOR): New macro.
* gcc-interface/decl.c: Include urealp.h
(gnat_to_gnu_entity): Attach trees to encode scale factors to
fixed-point types.
* gcc-interface/misc.c (gnat_print_type): Print scale factors
for fixed-point types.
(gnat_get_fixed_point_type_info): New.
(gnat_init_ts): Initialize data for the POWER_EXPR binary
operation.
(LANG_HOOKS_GET_FIXED_POINT_INFO): Redefine macro to implement
the get_fixed_point_type_info language hook.

gcc/ChangeLog:

* langhooks.h (struct lang_hooks_for_types): Add a
get_fixed_point_type_info field.
* langhooks-def.h (LANG_HOOKS_GET_FIXED_POINT_TYPE_INFO): New
macro.
(LANG_HOOKS_FOR_TYPES_INITIALIZER): Initialize the
get_fixed_point_type_info field.
* dwarf2out.h (enum fixed_point_scale_factor): New.
(struct fixed_point_type_info): New.
* dwarf2out.c (base_type_die): In DWARFv3 or non-strict DWARF
mode, get fixed-point type information using the debugging hook
and describe it in DWARF, if any.

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