]> git.ipfire.org Git - thirdparty/gcc.git/commit - gcc/langhooks.h
PR debug/16063. Add DW_AT_type to DW_TAG_enumeration.
authormark <mark@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 21 May 2014 15:44:59 +0000 (15:44 +0000)
committermark <mark@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 21 May 2014 15:44:59 +0000 (15:44 +0000)
commit1b006e46754125c47544223aa6ee8a42d102fe4d
treed20dfd76b6bd33f6d7a2c6e5a1ca0f62dcebe91a
parent667e5de8d01aa754c727efe58ad06079259e986f
PR debug/16063. Add DW_AT_type to DW_TAG_enumeration.

Add a new lang-hook that provides the underlying base type of an
ENUMERAL_TYPE. The default implementation will just use type_for_size.
The implementation for C++ will use the ENUM_UNDERLYING_TYPE if it exists.
Use this enum_underlying_base_type lang-hook in dwarf2out.c to add a
DW_AT_type base type reference to a DW_TAG_enumeration.

gcc/
* dwarf2out.c (gen_enumeration_type_die): Add DW_AT_type if DWARF
version >= 3 or not strict DWARF.
* langhooks.h (struct lang_hooks_for_types): Add
enum_underlying_base_type.
* langhooks.c (lhd_enum_underlying_base_type): New function.
* gcc/langhooks.h (struct lang_hooks_for_types): Add
enum_underlying_base_type.
* langhooks-def.h (lhd_enum_underlying_base_type): New declaration.
(LANG_HOOKS_ENUM_UNDERLYING_BASE_TYPE): New define.
(LANG_HOOKS_FOR_TYPES_INITIALIZER): Add new lang hook.

gcc/cp/
* cp-lang.c (cxx_enum_underlying_base_type): New function.
(LANG_HOOKS_ENUM_UNDERLYING_BASE_TYPE): Define.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@210717 138bc75d-0d04-0410-961f-82ee72b054a4
gcc/ChangeLog
gcc/cp/ChangeLog
gcc/cp/cp-lang.c
gcc/dwarf2out.c
gcc/langhooks-def.h
gcc/langhooks.c
gcc/langhooks.h