This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] PR debug/16063. Add DW_AT_type to DW_TAG_enumeration.
- From: Mark Wielaard <mjw at redhat dot com>
- To: Richard Biener <richard dot guenther at gmail dot com>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>, Tom Tromey <tromey at redhat dot com>
- Date: Mon, 24 Mar 2014 11:46:54 +0100
- Subject: Re: [PATCH] PR debug/16063. Add DW_AT_type to DW_TAG_enumeration.
- Authentication-results: sourceware.org; auth=none
- References: <1395573501-21296-1-git-send-email-mjw at redhat dot com> <CAFiYyc0z6oGg82QwUQg1QS7HNv7JLX0Ps8+WfssYzOu0fnAGfQ at mail dot gmail dot com>
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