aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/gcc-interface
diff options
context:
space:
mode:
authorTom Tromey <tromey@adacore.com>2024-07-31 09:01:45 -0600
committerMarc Poulhiès <dkm@gcc.gnu.org>2024-10-25 11:09:04 +0200
commit7124671cadc5a9f21bb9332b5fd68d29fdcdef52 (patch)
treefb4beb8240b41bc1161fc668160d2cdd1a41ef7d /gcc/ada/gcc-interface
parenta60e7289350d7b04d4c81187070d705f441e9c70 (diff)
downloadgcc-7124671cadc5a9f21bb9332b5fd68d29fdcdef52.zip
gcc-7124671cadc5a9f21bb9332b5fd68d29fdcdef52.tar.gz
gcc-7124671cadc5a9f21bb9332b5fd68d29fdcdef52.tar.bz2
ada: Change scope of XUB type
An earlier patch in the "nameless" series caused a regression with -fgnat-encodings=all. Previously, all artificial types were emitted in the CU scope in the DWARF, but with the patch, an "XUB" type is emitted in the function scope. This causes gdb lookups to erroneously find the XUB type rather than the type that gdb expects to find. Note that I don't know why the earlier code worked, because decl.cc clearly sets the XUB type's context to be the current function. This patch changes the type's context so that it is nested in a type that is conveniently available. gcc/ada/ChangeLog: * gcc-interface/decl.cc (gnat_to_gnu_entity): Use gnu_fat_type as the type context for a XUB type.
Diffstat (limited to 'gcc/ada/gcc-interface')
-rw-r--r--gcc/ada/gcc-interface/decl.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/gcc/ada/gcc-interface/decl.cc b/gcc/ada/gcc-interface/decl.cc
index 372d72a..3404b74 100644
--- a/gcc/ada/gcc-interface/decl.cc
+++ b/gcc/ada/gcc-interface/decl.cc
@@ -2401,7 +2401,7 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, bool definition)
= chainon (gnu_template_fields, gnu_temp_fields[index]);
finish_record_type (gnu_template_type, gnu_template_fields, 0,
debug_info_p);
- TYPE_CONTEXT (gnu_template_type) = current_function_decl;
+ TYPE_CONTEXT (gnu_template_type) = gnu_fat_type;
/* If Component_Size is not already specified, annotate it with the
size of the component. */