Patchwork Make dwarf2out use DECL_FILE_SCOPE_P some more

login
register
mail settings
Submitter Richard Guenther
Date Oct. 1, 2010, 10:44 a.m.
Message ID <alpine.LNX.2.00.1010011244150.8982@zhemvz.fhfr.qr>
Download mbox | patch
Permalink /patch/66336/
State New
Headers show

Comments

Richard Guenther - Oct. 1, 2010, 10:44 a.m.
Bootstrapped and tested on x86_64-unknown-linux-gnu, committed.

Richard.

2010-10-01  Richard Guenther  <rguenther@suse.de>

	* dwarf2out.c (gen_namespace_die): Use DECL_FILE_SCOPE_P.
	(gen_decl_die): Likewise.

Patch

Index: dwarf2out.c
===================================================================
--- dwarf2out.c	(revision 164751)
+++ dwarf2out.c	(working copy)
@@ -20596,7 +20596,7 @@  gen_namespace_die (tree decl, dw_die_ref
       dw_die_ref origin_die
 	= force_decl_die (DECL_ABSTRACT_ORIGIN (decl));
 
-      if (DECL_CONTEXT (decl) == NULL_TREE
+      if (DECL_FILE_SCOPE_P (decl)
 	  || TREE_CODE (DECL_CONTEXT (decl)) == NAMESPACE_DECL)
 	context_die = setup_namespace_context (decl, comp_unit_die ());
       /* Now create the namespace alias DIE.  */
@@ -20646,7 +20646,7 @@  gen_decl_die (tree decl, tree origin, dw
       /* Don't output any DIEs to represent mere function declarations,
 	 unless they are class members or explicit block externs.  */
       if (DECL_INITIAL (decl_or_origin) == NULL_TREE
-          && DECL_CONTEXT (decl_or_origin) == NULL_TREE
+          && DECL_FILE_SCOPE_P (decl_or_origin)
 	  && (current_function_decl == NULL_TREE
 	      || DECL_ARTIFICIAL (decl_or_origin)))
 	break;