This patch emits discriminator for inlined callsite. This is important
when there are two inlined callsites in the same line.
Bootstrapped, testing on going.
OK for google branches?
Thanks,
Dehao
Index: gcc/dwarf2out.c
===================================================================
--- gcc/dwarf2out.c (revision 201632)
+++ gcc/dwarf2out.c (working copy)
@@ -18807,12 +18807,16 @@ gen_label_die (tree decl, dw_die_ref context_die)
static inline void
add_call_src_coords_attributes (tree stmt, dw_die_ref die)
{
- 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);
}
}