From patchwork Thu Oct 18 18:44:49 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Botcazou X-Patchwork-Id: 192402 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 ADD0B2C0092 for ; Fri, 19 Oct 2012 05:47:43 +1100 (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=1351190864; h=Comment: DomainKey-Signature:Received:Received:Received:Received:Received: Received:From:To:Subject:Date:Message-ID:User-Agent:MIME-Version: Content-Type:Content-Transfer-Encoding:Mailing-List:Precedence: List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender: Delivered-To; bh=CmVKt1JqRixBsYm/o6X6p0AaTWc=; b=nf94tWVlK7dYExP swW/Au68tv1+b2bDmdDpqm4SPDNhOcOBNB2zxDFkfmSwX2jvLYmHWqlfe6RIUT0g xkJunTqDC27svmAVXIO89Sa9dOzA73GFcI+QqrbtJQ4R/61uiQTJbVA9nCB+LLaS im5g81hTZD6m3eyt3AI/UMNlfXgg= 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:Received:From:To:Subject:Date:Message-ID:User-Agent:MIME-Version:Content-Type:Content-Transfer-Encoding:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=f1T/cYi2leHeajBd5CsIEnB8zgnOP7tyfrH4iolT3rAeFctdQVdWfRiMQVlacG u5eqCEuxALAs9bZ+IiGJWqOihZdzKAw++BeT/Zv0tKA5A+13nRxLncdEK7EMWXPl 6T1/2ek/wwOM2ttHf5wc8z+0hJtjSJbI0gtGsUub6Nso0=; Received: (qmail 30182 invoked by alias); 18 Oct 2012 18:47:36 -0000 Received: (qmail 29942 invoked by uid 22791); 18 Oct 2012 18:47:35 -0000 X-SWARE-Spam-Status: No, hits=-2.1 required=5.0 tests=AWL, BAYES_00, TW_XL, TW_XR X-Spam-Check-By: sourceware.org Received: from mel.act-europe.fr (HELO mel.act-europe.fr) (194.98.77.210) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 18 Oct 2012 18:47:29 +0000 Received: from localhost (localhost [127.0.0.1]) by filtered-smtp.eu.adacore.com (Postfix) with ESMTP id 4113A290548 for ; Thu, 18 Oct 2012 20:47:28 +0200 (CEST) Received: from mel.act-europe.fr ([127.0.0.1]) by localhost (smtp.eu.adacore.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 3dpxorUfnZNw for ; Thu, 18 Oct 2012 20:47:28 +0200 (CEST) Received: from polaris.localnet (bon31-6-88-161-99-133.fbx.proxad.net [88.161.99.133]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mel.act-europe.fr (Postfix) with ESMTP id 10D2B290546 for ; Thu, 18 Oct 2012 20:47:28 +0200 (CEST) From: Eric Botcazou To: gcc-patches@gcc.gnu.org Subject: [c-family] Small fix for -fdump-ada-spec Date: Thu, 18 Oct 2012 20:44:49 +0200 Message-ID: <4759815.ojHB7dFO0n@polaris> User-Agent: KMail/4.7.2 (Linux/3.1.10-1.16-desktop; KDE/4.7.2; x86_64; ; ) 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 The recent introduction of virtual locations revealed a weak spot in the implementation of -fdump-ada-spec. Tested on x86_64-suse-linux, applied on the mainline as obvious. 2012-10-18 Eric Botcazou * c-ada-spec.c (LOCATION_COL): Delete. (compare_location): New function. (compare_node): Use it. (compare_comment): Likewise. Index: c-ada-spec.c =================================================================== --- c-ada-spec.c (revision 192526) +++ c-ada-spec.c (working copy) @@ -67,8 +67,6 @@ static void dump_ads (const char *, void static char *to_ada_name (const char *, int *); static bool separate_class_package (tree); -#define LOCATION_COL(LOC) ((expand_location (LOC)).column) - #define INDENT(SPACE) do { \ int i; for (i = 0; isloc) != LOCATION_FILE (rhs->sloc)) - return filename_cmp (LOCATION_FILE (lhs->sloc), - LOCATION_FILE (rhs->sloc)); - - if (LOCATION_LINE (lhs->sloc) != LOCATION_LINE (rhs->sloc)) - return LOCATION_LINE (lhs->sloc) - LOCATION_LINE (rhs->sloc); - - if (LOCATION_COL (lhs->sloc) != LOCATION_COL (rhs->sloc)) - return LOCATION_COL (lhs->sloc) - LOCATION_COL (rhs->sloc); - - return 0; + return compare_location (lhs->sloc, rhs->sloc); } static tree *to_dump = NULL;