From patchwork Fri Oct 1 10:44:46 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Biener X-Patchwork-Id: 66336 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id B5511B70CC for ; Fri, 1 Oct 2010 20:45:01 +1000 (EST) Received: (qmail 14399 invoked by alias); 1 Oct 2010 10:44:58 -0000 Received: (qmail 14379 invoked by uid 22791); 1 Oct 2010 10:44:57 -0000 X-SWARE-Spam-Status: No, hits=-5.9 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from cantor.suse.de (HELO mx1.suse.de) (195.135.220.2) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 01 Oct 2010 10:44:49 +0000 Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.221.2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.suse.de (Postfix) with ESMTP id 3934B94430 for ; Fri, 1 Oct 2010 12:44:47 +0200 (CEST) Date: Fri, 1 Oct 2010 12:44:46 +0200 (CEST) From: Richard Guenther To: gcc-patches@gcc.gnu.org Subject: [PATCH] Make dwarf2out use DECL_FILE_SCOPE_P some more Message-ID: User-Agent: Alpine 2.00 (LNX 1167 2008-08-23) MIME-Version: 1.0 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Bootstrapped and tested on x86_64-unknown-linux-gnu, committed. Richard. 2010-10-01 Richard Guenther * dwarf2out.c (gen_namespace_die): Use DECL_FILE_SCOPE_P. (gen_decl_die): Likewise. 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;