This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [GOOGLE] Add discriminator for inlined callsite
- From: Cary Coutant <ccoutant at google dot com>
- To: Dehao Chen <dehao at google dot com>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Mon, 19 Aug 2013 09:31:28 -0700
- Subject: Re: [GOOGLE] Add discriminator for inlined callsite
- References: <CAO2gOZXxfJf7Ps=7AVTu25gr++4KPyEdmWGdSk0uVqrUX8cFiQ at mail dot gmail dot com>
> - expanded_location s = expand_location (BLOCK_SOURCE_LOCATION (stmt));
> + location_t locus = BLOCK_SOURCE_LOCATION (stmt);
> + expanded_location s = expand_location (locus);
>
> if (dwarf_version >= 3 || !dwarf_strict)
> {
> add_AT_file (die, DW_AT_call_file, lookup_filename (s.file));
> add_AT_unsigned (die, DW_AT_call_line, s.line);
> + unsigned discr = get_discriminator_from_locus (locus);
> + if (discr != 0)
> + add_AT_unsigned (die, DW_AT_discr, discr);
DW_AT_discr is used to identify the "discriminant" for variant
records; we should not reuse it for the discriminator, even if it's
the case that the other meaning could never apply to a
DW_TAG_inlined_subroutine. You should instead add a new
DW_AT_GNU_discriminator to include/dwarf2.def and use that. 0x2136
looks like the next value in the GNU vendor range. Note that
dwarf2.def lives in both GCC and binutils repos, so once you have
approval to commit to the GCC repo, you'll need to commit the same
change to the binutils repo as well.
-cary