aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorAndrew Stubbs <ams@codesourcery.com>2021-01-15 11:26:46 +0000
committerSandra Loosemore <sloosemore@baylibre.com>2025-05-15 20:25:46 +0000
commit113638d2ab90b8b104a2e42d5c9470a9bda98bb5 (patch)
treea8aa09c6afa1ed845d6bc7240cf24e145ab9b26c /gcc
parent6e115c050c648c8e3cf4f3cb3c5dae6feb348205 (diff)
downloadgcc-113638d2ab90b8b104a2e42d5c9470a9bda98bb5.zip
gcc-113638d2ab90b8b104a2e42d5c9470a9bda98bb5.tar.gz
gcc-113638d2ab90b8b104a2e42d5c9470a9bda98bb5.tar.bz2
DWARF address space for variables
Add DWARF address class attributes for variables that exist outside the generic address space. In particular, this is the case for gang-private variables in OpenACC offload kernels. gcc/ChangeLog: * dwarf2out.cc (add_location_or_const_value_attribute): Set DW_AT_address_class, if appropriate.
Diffstat (limited to 'gcc')
-rw-r--r--gcc/dwarf2out.cc9
1 files changed, 9 insertions, 0 deletions
diff --git a/gcc/dwarf2out.cc b/gcc/dwarf2out.cc
index 1473f73..8c711e4 100644
--- a/gcc/dwarf2out.cc
+++ b/gcc/dwarf2out.cc
@@ -21030,6 +21030,15 @@ add_location_or_const_value_attribute (dw_die_ref die, tree decl, bool cache_p)
if (list)
{
add_AT_location_description (die, DW_AT_location, list);
+
+ addr_space_t as = TYPE_ADDR_SPACE (TREE_TYPE (decl));
+ if (!ADDR_SPACE_GENERIC_P (as))
+ {
+ int action = targetm.addr_space.debug (as);
+ /* Positive values indicate an address_class. */
+ if (action >= 0)
+ add_AT_unsigned (die, DW_AT_address_class, action);
+ }
return true;
}
/* None of that worked, so it must not really have a location;