[PATCH] Emit DWARF5 DW_AT_reference and DW_AT_rvalue_reference

Jason Merrill jason@redhat.com
Mon Oct 24 18:34:00 GMT 2016

On Mon, Oct 24, 2016 at 10:29 AM, Jakub Jelinek <jakub@redhat.com> wrote:
> This is another addition in DWARF5.  The patch emits these attributes
> only for DW_TAG_subprogram for non-static ref-qualified member functions.
> Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk?


> We really should emit it also for DW_TAG_subroutine_type for PMF types,
> the problem is that for FUNCTION_TYPE/METHOD_TYPE, dwarf2out.c uses
> type_main_variant and get_qualified_type, neither of them understand
> ref-qualifies.  I think we'd need to change get_qualified_type to use
> some lang-hook which for C++ would also check the ref qualifiers, and then
> for these two avoid type_main_variant and instead use get_qualified_type
> to get the non-const/volatile/restrict etc. qualified one (and only then
> we can use the decl_dwarf_attribute langhook to ask the FE whether the
> attribute should be emitted).  Does that make sense, or do you have another
> approach?

Can we pull out the ref-qualifier before we clobber the qualifiers on the type?

> Is it ok to use decl_dwarf_attribute langhook for that, or
> do we need type_dwarf_attribute?

I think it's fine to use the same langhook, but we probably want to rename it.


More information about the Gcc-patches mailing list