]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
ada: Mark some type decls as nameless
authorTom Tromey <tromey@adacore.com>
Wed, 10 Jul 2024 17:54:25 +0000 (11:54 -0600)
committerMarc Poulhiès <dkm@gcc.gnu.org>
Fri, 25 Oct 2024 09:09:04 +0000 (11:09 +0200)
The types created by record_builtin_type and create_type_stub_decl can
be marked as nameless when using minimal encodings.  In this
situation, gdb does not need these type names.

gcc/ada/ChangeLog:

* gcc-interface/utils.cc (record_builtin_type, create_type_stub_decl):
Set DECL_NAMELESS on type decls.

gcc/ada/gcc-interface/utils.cc

index 9e2715a8d81ff4b1959e5daf11f450bb5b6d16c0..a06366bf40e4a166e68d46272736b079a2c11377 100644 (file)
@@ -2019,6 +2019,8 @@ record_builtin_type (const char *name, tree type, bool artificial_p)
   tree type_decl = build_decl (input_location,
                               TYPE_DECL, get_identifier (name), type);
   DECL_ARTIFICIAL (type_decl) = artificial_p;
+  DECL_NAMELESS (type_decl) = (artificial_p
+                              && gnat_encodings != DWARF_GNAT_ENCODINGS_ALL);
   TYPE_ARTIFICIAL (type) = artificial_p;
   gnat_pushdecl (type_decl, Empty);
 
@@ -2835,6 +2837,7 @@ create_type_stub_decl (tree name, tree type)
 {
   tree type_decl = build_decl (input_location, TYPE_DECL, name, type);
   DECL_ARTIFICIAL (type_decl) = 1;
+  DECL_NAMELESS (type_decl) = gnat_encodings != DWARF_GNAT_ENCODINGS_ALL;
   TYPE_ARTIFICIAL (type) = 1;
   return type_decl;
 }