This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] PR debug/16063. Add DW_AT_type to DW_TAG_enumeration.


On Mon, 2014-03-24 at 10:26 +0100, Richard Biener wrote:
> On Sun, Mar 23, 2014 at 12:18 PM, Mark Wielaard <mjw@redhat.com> wrote:
> > Add a new lang-hook that provides the underlying base type of an
> > ENUMERAL_TYPE. Including implementations for C and C++. 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.
> 
> Don't we have TREE_TYPE (enum-type) as that type?  Thus, can we avoid
> adding the new langhook?

The underlying type is the integral base type of the enum, which, at
least for C++, can be different from the tree type of the enum. See also
cp/semantics.c (finish_underlying_type) which calculates it in the C++
case.

Cheers,

Mark


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]