diff options
author | pmderodat <pmderodat@138bc75d-0d04-0410-961f-82ee72b054a4> | 2015-12-17 14:10:24 +0000 |
---|---|---|
committer | pmderodat <pmderodat@138bc75d-0d04-0410-961f-82ee72b054a4> | 2015-12-17 14:10:24 +0000 |
commit | e0501e5ff8e317a259967c6e87f11357fd65c6d4 (patch) | |
tree | 4b1283cf84906d22bbc457ae4eb42f1b824396c1 /gcc/langhooks.h | |
parent | 584cdd4fbf89854054b1a2174f2ec8f3be953199 (diff) | |
download | gcc-e0501e5ff8e317a259967c6e87f11357fd65c6d4.tar.gz |
DWARF: add a language hook for scalar biased types
Front-ends like GNAT for Ada sometimes use biased encodings for integral
types. This change creates a new language hook so that the bias
information can make it into the debugging information back-end and
introduces an experimental DWARF attribute to hold it.
gcc/ada/ChangeLog:
* gcc-interface/misc.c (gnat_get_type_bias): New.
(LANG_HOOKS_GET_TYPE_BIAS): Redefine macro to implement the
get_type_bias language hook.
gcc/ChangeLog:
* langhooks.h (struct lang_hooks_for_types): New get_bias_field.
* langhooks-def.h (LANG_HOOKS_GET_TYPE_BIAS): New.
(LANG_HOOKS_FOR_TYPES_INITIALIZER): Initialize the
get_bias_field.
* dwarf2out.c
(base_type_die): In non-strict DWARF mode, invoke the
get_type_bias language hook for INTEGER_TYPE nodes. If it
returns a bias, emit an attribute for it.
(subrange_type_die): Change signature to handle bias. If
non-strict DWARF mode, emit an attribute for it, if one passed.
(modified_type_die): For subrange types, invoke the
get_type_bias langage hook and pass the bias to
subrange_type_die.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@231767 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/langhooks.h')
-rw-r--r-- | gcc/langhooks.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/gcc/langhooks.h b/gcc/langhooks.h index f84bdf64bf4..95d5840d0a9 100644 --- a/gcc/langhooks.h +++ b/gcc/langhooks.h @@ -127,6 +127,11 @@ struct lang_hooks_for_types /* Fill in information for the debugger about the bounds of TYPE. */ void (*get_subrange_bounds) (const_tree, tree *, tree *); + /* Called on INTEGER_TYPEs. Return NULL_TREE for non-biased types. For + biased types, return as an INTEGER_CST node the value that is represented + by a physical zero. */ + tree (*get_type_bias) (const_tree); + /* A type descriptive of TYPE's complex layout generated to help the debugger to decode variable-length or self-referential constructs. This is only used for the AT_GNAT_descriptive_type DWARF attribute. */ |