aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEugene Rozenfeld <erozen@microsoft.com>2022-04-21 16:17:52 -0700
committerEugene Rozenfeld <erozen@microsoft.com>2022-09-30 17:35:39 -0700
commitc3cb74aee204a41f7049617d453f2c20c2b1febe (patch)
tree17ada8512a76de3c7691d64db9b7541dea185d25
parent3a221b73d04496318c5b7b69c1d78d6ff83a8bfb (diff)
downloadgcc-c3cb74aee204a41f7049617d453f2c20c2b1febe.zip
gcc-c3cb74aee204a41f7049617d453f2c20c2b1febe.tar.gz
gcc-c3cb74aee204a41f7049617d453f2c20c2b1febe.tar.bz2
Emit discriminators for inlined call sites.
This change is based on commit 9fa26998a63d4b22b637ed8702520819e408a694 by Dehao Chen in vendors/google/heads/gcc-4_8. Tested on x86_64-pc-linux-gnu. gcc/ChangeLog: * dwarf2out.cc (add_call_src_coords_attributes): Emit discriminators for inlined call sites.
-rw-r--r--gcc/dwarf2out.cc6
1 files changed, 5 insertions, 1 deletions
diff --git a/gcc/dwarf2out.cc b/gcc/dwarf2out.cc
index 2df7590..e81044b 100644
--- a/gcc/dwarf2out.cc
+++ b/gcc/dwarf2out.cc
@@ -24783,7 +24783,8 @@ add_call_src_coords_attributes (tree stmt, dw_die_ref die)
if (RESERVED_LOCATION_P (BLOCK_SOURCE_LOCATION (stmt)))
return;
- 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)
{
@@ -24791,6 +24792,9 @@ add_call_src_coords_attributes (tree stmt, dw_die_ref die)
add_AT_unsigned (die, DW_AT_call_line, s.line);
if (debug_column_info && s.column)
add_AT_unsigned (die, DW_AT_call_column, s.column);
+ unsigned discr = get_discriminator_from_loc (locus);
+ if (discr != 0)
+ add_AT_unsigned (die, DW_AT_GNU_discriminator, discr);
}
}