From patchwork Mon Apr 30 16:50:09 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jason Merrill X-Patchwork-Id: 155924 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 C2C79B6FA4 for ; Tue, 1 May 2012 02:50:41 +1000 (EST) Comment: DKIM? See http://www.dkim.org DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=gcc.gnu.org; s=default; x=1336409442; h=Comment: DomainKey-Signature:Received:Received:Received:Received:Received: Message-ID:Date:From:User-Agent:MIME-Version:To:Subject: Content-Type:Mailing-List:Precedence:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:Sender:Delivered-To; bh=6ErPlhz 2F1WN0rernkusFyYjaSU=; b=Jg3OPC9Smz4OprG9KYHHiOJ/DpJW337TbFApzQA F4dQUDWfLfijwmZgZOUGGm5Gk2s9ce1SFsehqeuChvsB8U4FyOXXt807x7PrrtS9 0RJBxMqlMce8poTv6/+NN/GWqYWbnAsWdiBrJf8awLBcz+Otu6UDk9sbrBGplDjd 2YoQ= Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=gcc.gnu.org; h=Received:Received:X-SWARE-Spam-Status:X-Spam-Check-By:Received:Received:Received:Message-ID:Date:From:User-Agent:MIME-Version:To:Subject:Content-Type:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=frju6sK0JO4mSpaTwJJyW8RqMWmGTIGMLzcZviIg+ctygZ+L+WrrJMJJFjDc+V cO1SUlI38PFsMLS64pbJfnLmjjpAsI4ipFaA4FH8NbJK6PfpWl+A/dC+Af0GYpUT UEzm+WRLG75zJdEJ3avFfSFXRkWQB6xu0pkVffH6ewXmE=; Received: (qmail 21218 invoked by alias); 30 Apr 2012 16:50:30 -0000 Received: (qmail 21137 invoked by uid 22791); 30 Apr 2012 16:50:28 -0000 X-SWARE-Spam-Status: No, hits=-6.2 required=5.0 tests=AWL, BAYES_00, KHOP_RCVD_UNTRUST, RCVD_IN_DNSWL_HI, RCVD_IN_HOSTKARMA_W, SPF_HELO_PASS, T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 30 Apr 2012 16:50:11 +0000 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q3UGoA2A030362 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 30 Apr 2012 12:50:10 -0400 Received: from [10.3.113.6] ([10.3.113.6]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id q3UGo9ph005411 for ; Mon, 30 Apr 2012 12:50:10 -0400 Message-ID: <4F9EC2C1.9070402@redhat.com> Date: Mon, 30 Apr 2012 12:50:09 -0400 From: Jason Merrill User-Agent: Mozilla/5.0 (X11; Linux i686; rv:11.0) Gecko/20120329 Thunderbird/11.0.1 MIME-Version: 1.0 To: gcc-patches List Subject: minor PATCH to constify symbols in dwarf2out.c 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 Some other changes I've been working on needed this const-correctness adjustment. Tested x86_64-pc-linux-gnu, applying to trunk. commit e69aeb777fdbbcecbc603c9b91ef3dc17cf812a5 Author: Jason Merrill Date: Thu Apr 19 10:02:22 2012 -0400 * dwarf2out.c (comdat_symbol_id): Add const. (union die_symbol_or_type_node): Add const to die_symbol. (output_die_symbol, output_die, output_comp_unit): Adjust. diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c index 98b53f0..fd485fb 100644 --- a/gcc/dwarf2out.c +++ b/gcc/dwarf2out.c @@ -2470,7 +2470,7 @@ DEF_VEC_ALLOC_O(dw_attr_node,gc); typedef struct GTY((chain_circular ("%h.die_sib"))) die_struct { union die_symbol_or_type_node { - char * GTY ((tag ("0"))) die_symbol; + const char * GTY ((tag ("0"))) die_symbol; comdat_type_node_ref GTY ((tag ("1"))) die_type_node; } GTY ((desc ("use_debug_types"))) die_id; @@ -5825,7 +5825,7 @@ same_die_p_wrap (dw_die_ref die1, dw_die_ref die2) /* The prefix to attach to symbols on DIEs in the current comdat debug info section. */ -static char *comdat_symbol_id; +static const char *comdat_symbol_id; /* The index of the current symbol within the current comdat CU. */ static unsigned int comdat_symbol_number; @@ -7396,7 +7396,7 @@ output_abbrev_section (void) static inline void output_die_symbol (dw_die_ref die) { - char *sym = die->die_id.die_symbol; + const char *sym = die->die_id.die_symbol; if (sym == 0) return; @@ -7678,7 +7678,7 @@ output_die (dw_die_ref die) } else { - char *sym = AT_ref (a)->die_id.die_symbol; + const char *sym = AT_ref (a)->die_id.die_symbol; int size; gcc_assert (sym); @@ -7800,8 +7800,8 @@ output_compilation_unit_header (void) static void output_comp_unit (dw_die_ref die, int output_if_empty) { - const char *secname; - char *oldsym, *tmp; + const char *secname, *oldsym; + char *tmp; /* Unless we are outputting main CU, we may throw away empty ones. */ if (!output_if_empty && die->die_child == NULL)