public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] Use DW_TAG_module for Ada
@ 2024-05-03 17:08 Tom Tromey
  2024-05-17 13:21 ` Tom Tromey
  2024-05-17 14:17 ` Jakub Jelinek
  0 siblings, 2 replies; 3+ messages in thread
From: Tom Tromey @ 2024-05-03 17:08 UTC (permalink / raw)
  To: gcc-patches; +Cc: Tom Tromey

DWARF is not especially clear on the distinction between
DW_TAG_namespace and DW_TAG_module, but I think that DW_TAG_module is
more appropriate for Ada.  This patch changes the compiler to do this.
Note that the Ada compiler does not yet create NAMESPACE_DECLs.

gcc

	* dwarf2out.cc (gen_namespace_die): Use DW_TAG_module for Ada.
---
 gcc/dwarf2out.cc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gcc/dwarf2out.cc b/gcc/dwarf2out.cc
index 1b0e8b5a5b2..1e46c27cdf7 100644
--- a/gcc/dwarf2out.cc
+++ b/gcc/dwarf2out.cc
@@ -26992,7 +26992,7 @@ gen_namespace_die (tree decl, dw_die_ref context_die)
     {
       /* Output a real namespace or module.  */
       context_die = setup_namespace_context (decl, comp_unit_die ());
-      namespace_die = new_die (is_fortran () || is_dlang ()
+      namespace_die = new_die (is_fortran () || is_dlang () || is_ada ()
 			       ? DW_TAG_module : DW_TAG_namespace,
 			       context_die, decl);
       /* For Fortran modules defined in different CU don't add src coords.  */
-- 
2.44.0


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] Use DW_TAG_module for Ada
  2024-05-03 17:08 [PATCH] Use DW_TAG_module for Ada Tom Tromey
@ 2024-05-17 13:21 ` Tom Tromey
  2024-05-17 14:17 ` Jakub Jelinek
  1 sibling, 0 replies; 3+ messages in thread
From: Tom Tromey @ 2024-05-17 13:21 UTC (permalink / raw)
  To: Tom Tromey; +Cc: gcc-patches

>>>>> "Tom" == Tom Tromey <tromey@adacore.com> writes:

Tom> DWARF is not especially clear on the distinction between
Tom> DW_TAG_namespace and DW_TAG_module, but I think that DW_TAG_module is
Tom> more appropriate for Ada.  This patch changes the compiler to do this.
Tom> Note that the Ada compiler does not yet create NAMESPACE_DECLs.

Ping.

Tom

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] Use DW_TAG_module for Ada
  2024-05-03 17:08 [PATCH] Use DW_TAG_module for Ada Tom Tromey
  2024-05-17 13:21 ` Tom Tromey
@ 2024-05-17 14:17 ` Jakub Jelinek
  1 sibling, 0 replies; 3+ messages in thread
From: Jakub Jelinek @ 2024-05-17 14:17 UTC (permalink / raw)
  To: Tom Tromey; +Cc: gcc-patches

On Fri, May 03, 2024 at 11:08:04AM -0600, Tom Tromey wrote:
> DWARF is not especially clear on the distinction between
> DW_TAG_namespace and DW_TAG_module, but I think that DW_TAG_module is
> more appropriate for Ada.  This patch changes the compiler to do this.
> Note that the Ada compiler does not yet create NAMESPACE_DECLs.
> 
> gcc
> 
> 	* dwarf2out.cc (gen_namespace_die): Use DW_TAG_module for Ada.

Ok, thanks.

> diff --git a/gcc/dwarf2out.cc b/gcc/dwarf2out.cc
> index 1b0e8b5a5b2..1e46c27cdf7 100644
> --- a/gcc/dwarf2out.cc
> +++ b/gcc/dwarf2out.cc
> @@ -26992,7 +26992,7 @@ gen_namespace_die (tree decl, dw_die_ref context_die)
>      {
>        /* Output a real namespace or module.  */
>        context_die = setup_namespace_context (decl, comp_unit_die ());
> -      namespace_die = new_die (is_fortran () || is_dlang ()
> +      namespace_die = new_die (is_fortran () || is_dlang () || is_ada ()
>  			       ? DW_TAG_module : DW_TAG_namespace,
>  			       context_die, decl);
>        /* For Fortran modules defined in different CU don't add src coords.  */
> -- 
> 2.44.0

	Jakub


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-05-17 14:17 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-05-03 17:08 [PATCH] Use DW_TAG_module for Ada Tom Tromey
2024-05-17 13:21 ` Tom Tromey
2024-05-17 14:17 ` Jakub Jelinek

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).