public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [Ada] Emit named pointer types in debug info
@ 2011-04-02  9:00 Eric Botcazou
  0 siblings, 0 replies; only message in thread
From: Eric Botcazou @ 2011-04-02  9:00 UTC (permalink / raw)
  To: gcc-patches

[-- Attachment #1: Type: text/plain, Size: 431 bytes --]

This makes it so that the Ada compiler emits named pointer types in the debug 
info (DW_TAG_typedef in DWARF) for pointer types declared in the sources.

Tested on i586-suse-linux, applied on the mainline.


2011-04-02  Eric Botcazou  <ebotcazou@adacore.com>

	* gcc-interface/utils.c (gnat_pushdecl): If this is a non-artificial
	declaration of a pointer type, then set DECL_ORIGINAL_TYPE to a
	distinct copy.


-- 
Eric Botcazou

[-- Attachment #2: p.diff --]
[-- Type: text/x-diff, Size: 1038 bytes --]

Index: gcc-interface/utils.c
===================================================================
--- gcc-interface/utils.c	(revision 171882)
+++ gcc-interface/utils.c	(working copy)
@@ -560,12 +560,16 @@ gnat_pushdecl (tree decl, Node_Id gnat_n
 
       if (!(TYPE_NAME (t) && TREE_CODE (TYPE_NAME (t)) == TYPE_DECL))
 	{
-	  /* Array types aren't tagged types in the C sense so we force the
+	  /* Array and pointer types aren't "tagged" types so we force the
 	     type to be associated with its typedef in the DWARF back-end,
 	     in order to make sure that the latter is always preserved.  */
-	  if (!DECL_ARTIFICIAL (decl) && TREE_CODE (t) == ARRAY_TYPE)
+	  if (!DECL_ARTIFICIAL (decl)
+	      && (TREE_CODE (t) == ARRAY_TYPE
+		  || TREE_CODE (t) == POINTER_TYPE))
 	    {
 	      tree tt = build_distinct_type_copy (t);
+	      if (TREE_CODE (t) == POINTER_TYPE)
+		TYPE_NEXT_PTR_TO (t) = tt;
 	      TYPE_NAME (tt) = DECL_NAME (decl);
 	      TYPE_STUB_DECL (tt) = TYPE_STUB_DECL (t);
 	      DECL_ORIGINAL_TYPE (decl) = tt;

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2011-04-02  9:00 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-04-02  9:00 [Ada] Emit named pointer types in debug info Eric Botcazou

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).