From patchwork Thu Oct 18 18:44:49 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [c-family] Small fix for -fdump-ada-spec Date: Thu, 18 Oct 2012 08:44:49 -0000 From: Eric Botcazou X-Patchwork-Id: 192402 Message-Id: <4759815.ojHB7dFO0n@polaris> To: 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;