This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Ada] Add Gigi support for new encoding of renaming


This is a follow-up to

  http://gcc.gnu.org/ml/gcc-patches/2007-09/msg00445.html

which has introduced a new encoding scheme to describe renaming declarations 
in the debug info generated by the compiler.

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


2007-09-10  Eric Botcazou  <ebotcazou@adacore.com>

	* decl.c (gnat_to_gnu_entity) <object>: Deal with variable built for
	a debug renaming declaration specially.


-- 
Eric Botcazou
Index: decl.c
===================================================================
--- decl.c	(revision 128268)
+++ decl.c	(working copy)
@@ -523,6 +523,21 @@ gnat_to_gnu_entity (Entity_Id gnat_entit
 	/* Get the type after elaborating the renamed object.  */
 	gnu_type = gnat_to_gnu_type (Etype (gnat_entity));
 
+	/* For a debug renaming declaration, build a pure debug entity.  */
+	if (Present (Debug_Renaming_Link (gnat_entity)))
+	  {
+	    rtx addr;
+	    gnu_decl = build_decl (VAR_DECL, gnu_entity_id, gnu_type);
+	    /* The (MEM (CONST (0))) pattern is prescribed by STABS.  */
+	    if (global_bindings_p ())
+	      addr = gen_rtx_CONST (VOIDmode, const0_rtx);
+	    else
+	      addr = stack_pointer_rtx;
+	    SET_DECL_RTL (gnu_decl, gen_rtx_MEM (Pmode, addr));
+	    gnat_pushdecl (gnu_decl, gnat_entity);
+	    break;
+	  }
+
 	/* If this is a loop variable, its type should be the base type.
 	   This is because the code for processing a loop determines whether
 	   a normal loop end test can be done by comparing the bounds of the

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]