diff options
author | Iain Sandoe <iain@sandoe.co.uk> | 2022-04-29 17:54:39 +0100 |
---|---|---|
committer | Iain Sandoe <iain@sandoe.co.uk> | 2022-04-29 17:54:39 +0100 |
commit | 3e5f7ca352c26a222bb588741b7c700a3052a372 (patch) | |
tree | 283aec084274668fe34c23c49ab2999390ed9778 /gcc/dwarf2ctf.cc | |
parent | 2ce0608ca3dca30518bec525c435f7bc4d7f9b70 (diff) | |
parent | b85e79dce149df68b92ef63ca2a40ff1dfa61396 (diff) | |
download | gcc-devel/c++-coroutines.tar.gz |
Merge master r12-8312.devel/c++-coroutines
* Merge master r12-8312-gb85e79dce149.
Diffstat (limited to 'gcc/dwarf2ctf.cc')
-rw-r--r-- | gcc/dwarf2ctf.cc | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/gcc/dwarf2ctf.cc b/gcc/dwarf2ctf.cc index 747b2f66107..a6329ab6ee4 100644 --- a/gcc/dwarf2ctf.cc +++ b/gcc/dwarf2ctf.cc @@ -808,12 +808,26 @@ gen_ctf_variable (ctf_container_ref ctfc, dw_die_ref die) if (ctf_dvd_lookup (ctfc, die)) return; + /* Do not generate CTF variable records for non-defining incomplete + declarations. Such declarations can be known via the DWARF + DW_AT_specification attribute. */ + if (ctf_dvd_ignore_lookup (ctfc, die)) + return; + + /* The value of the DW_AT_specification attribute, if present, is a + reference to the debugging information entry representing the + non-defining declaration. */ + dw_die_ref decl = get_AT_ref (die, DW_AT_specification); + /* Add the type of the variable. */ var_type_id = gen_ctf_type (ctfc, var_type); /* Generate the new CTF variable and update global counter. */ - (void) ctf_add_variable (ctfc, var_name, var_type_id, die, external_vis); - ctfc->ctfc_num_global_objts += 1; + (void) ctf_add_variable (ctfc, var_name, var_type_id, die, external_vis, + decl); + /* Skip updating the number of global objects at this time. This is updated + later after pre-processing as some CTF variable records although + generated now, will not be emitted later. [PR105089]. */ } /* Add a CTF function record for the given input DWARF DIE. */ |