Patchwork [Ada] Avoid generating duplicate debug info for enumerators

login
register
mail settings
Submitter Eric Botcazou
Date Sept. 19, 2010, 1:57 p.m.
Message ID <201009191557.34320.ebotcazou@adacore.com>
Download mbox | patch
Permalink /patch/65162/
State New
Headers show

Comments

Eric Botcazou - Sept. 19, 2010, 1:57 p.m.
This prevents the compiler from generating duplicate debug information for 
enumerators, first for the definition of the enumeration type and then for 
the individual constants themselves.

Tested on i586-suse-linux, applied on the mainline and 4.5 branch.


2010-09-19  Eric Botcazou  <ebotcazou@adacore.com>

	* gcc-interface/decl.c (gnat_to_gnu_entity) <E_Enumeration_Type>: Do
	not generate debug info for individual enumerators.

Patch

Index: gcc-interface/decl.c
===================================================================
--- gcc-interface/decl.c	(revision 164417)
+++ gcc-interface/decl.c	(working copy)
@@ -1525,7 +1525,8 @@  gnat_to_gnu_entity (Entity_Id gnat_entit
 	      = create_var_decl (get_entity_name (gnat_literal), NULL_TREE,
 				 gnu_type, gnu_value, true, false, false,
 				 false, NULL, gnat_literal);
-
+	    /* Do not generate debug info for individual enumerators.  */
+	    DECL_IGNORED_P (gnu_literal) = 1;
 	    save_gnu_tree (gnat_literal, gnu_literal, false);
 	    gnu_literal_list = tree_cons (DECL_NAME (gnu_literal),
 					  gnu_value, gnu_literal_list);