From patchwork Tue Nov 13 19:54:31 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Gulick X-Patchwork-Id: 997386 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-489943-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=mathworks.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="Cj578UKb"; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=mathworks.com header.i=@mathworks.com header.b="JRW6gbNV"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 42vddc0bbxz9s5c for ; Wed, 14 Nov 2018 06:55:14 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; q=dns; s= default; b=j22CDIk2BkpeYOWZ7wFoX+ShHSaGi/XT1WB8VgsCpn3t+Nr/Z91UC BUe3Spbkjb93AcZjUGcRyPaYLHFEuHUOfTSUaTAUSSWBeCBdO8xW12JlgEqQ7hsu rjc0NxRvyuCSVoWUuBY8EOLERpqmamZh763Z6Rbb3MY7TIoSlrOJs4= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; s=default; bh=dq8hyF+gd8o/5RnZTEUCUzcXlt0=; b=Cj578UKbRezX7GcFtjaegjVqYKdp P4B8a/VKdXwly91XSe2g0nUAtUD/eYShzAKdpwukQENO2kDFO+iNIuxE3PTaZV/c kSVwfT2TSTGymgp0oYbs9klneHIPGzTdPTpYtlvr8ANTTsDyC5zch0aYPoyyLN3P ZQOg4VevwtOetkw= Received: (qmail 8974 invoked by alias); 13 Nov 2018 19:55:06 -0000 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 Received: (qmail 8442 invoked by uid 89); 13 Nov 2018 19:55:05 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.2 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_LOTSOFHASH, SPF_PASS autolearn=ham version=3.3.2 spammy=shares, 9999, Thousands X-HELO: us-smtp-delivery-1.mimecast.com Received: from us-smtp-2.mimecast.com (HELO us-smtp-delivery-1.mimecast.com) (205.139.110.61) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 13 Nov 2018 19:55:01 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mathworks.com; s=mimecast20180117; t=1542138900; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=meJnCtGKel49XiOo16+9JaGV+AgBhr0tb5WbbM4FCZA=; b=JRW6gbNVSTHslSgBi9divK9Pv+y8ILLo3zFPAFKnr45GxoEjCoT5Z0sypUBYlVMtNR1vLaVjfuoFKKcfX4cmnS3PIIQUX6YBtqV3ZphvzVTThVX1j934slz70hFZsriialcivdwV6A6vUOCU7z1/3LUOZGpicsnfwam+5+i5P1E= Received: from NAM05-DM3-obe.outbound.protection.outlook.com (mail-dm3nam05lp0111.outbound.protection.outlook.com [216.32.181.111]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-274-cNJw4hcGMcGh8FlVVtNStg-1; Tue, 13 Nov 2018 14:54:55 -0500 Received: from SN4PR0501CA0025.namprd05.prod.outlook.com (2603:10b6:803:40::38) by BN6PR05MB3651.namprd05.prod.outlook.com (2603:10b6:405:3d::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1339.12; Tue, 13 Nov 2018 19:54:53 +0000 Received: from BY2NAM05FT060.eop-nam05.prod.protection.outlook.com (2a01:111:f400:7e52::203) by SN4PR0501CA0025.outlook.office365.com (2603:10b6:803:40::38) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1339.11 via Frontend Transport; Tue, 13 Nov 2018 19:54:53 +0000 Received: from exedge.mathworks.com (144.212.100.42) by BY2NAM05FT060.mail.protection.outlook.com (10.152.100.197) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1339.3 via Frontend Transport; Tue, 13 Nov 2018 19:54:53 +0000 Received: from ex16-01-ah.mathworks.com (172.31.80.219) by ex16edge-00-ah.mathworks.com (172.31.187.33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1466.3; Tue, 13 Nov 2018 14:53:46 -0500 Received: from ex16-00-ah.mathworks.com (172.31.39.22) by ex16-01-ah.mathworks.com (172.31.80.219) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1531.3; Tue, 13 Nov 2018 14:54:49 -0500 Received: from mail-vif.mathworks.com (144.212.95.101) by ex16-00-ah.mathworks.com (172.31.39.22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1466.3 via Frontend Transport; Tue, 13 Nov 2018 14:54:49 -0500 Received: from mgulick-deb9-64.dhcp.mathworks.com (mgulick-deb9-64.dhcp.mathworks.com [172.21.82.68]) by mail-vif.mathworks.com (8.14.7/8.14.7) with ESMTP id wADJsnpt000786; Tue, 13 Nov 2018 14:54:49 -0500 Received: (from mgulick@localhost) by mgulick-deb9-64.dhcp.mathworks.com (8.15.2/8.15.2/Submit) id wADJsmT4119512; Tue, 13 Nov 2018 14:54:48 -0500 From: Mike Gulick To: CC: David Malcolm , Mike Gulick Subject: [PATCH v4] PR preprocessor/83173: Enhance -fdump-internal-locations output Date: Tue, 13 Nov 2018 14:54:31 -0500 Message-ID: <20181113195431.119454-1-mgulick@mathworks.com> In-Reply-To: <1542070596.4619.23.camel@redhat.com> References: <1542070596.4619.23.camel@redhat.com> MIME-Version: 1.0 2018-11-13 Mike Gulick PR preprocessor/83173 * gcc/input.c (dump_location_info): Dump reason and included_from fields from line_map_ordinary struct. Fix indentation when location > 5 digits. * libcpp/location-example.txt: Update example -fdump-internal-locations output. * gcc/diagnostic-show-locus.c (num_digits, test_num_digits): Move to gcc/diagnostic.c to allow it to be utilized by gcc/input.c. * gcc/diagnostic.c (num_digits, test_num_digits): Moved here. (diagnostic_c_tests): Run test_num_digits. * gcc/diagnostic-core.h (num_digits): Add extern definition. --- gcc/diagnostic-show-locus.c | 51 ------ gcc/diagnostic.c | 46 +++++ gcc/diagnostic.h | 2 + gcc/input.c | 41 ++++- libcpp/location-example.txt | 333 +++++++++++++++++++++--------------- 5 files changed, 281 insertions(+), 192 deletions(-) diff --git a/gcc/diagnostic-show-locus.c b/gcc/diagnostic-show-locus.c index a42ff819512..08fe74a6136 100644 --- a/gcc/diagnostic-show-locus.c +++ b/gcc/diagnostic-show-locus.c @@ -819,56 +819,6 @@ fixit_cmp (const void *p_a, const void *p_b) return hint_a->get_start_loc () - hint_b->get_start_loc (); } -/* Get the number of digits in the decimal representation - of VALUE. */ - -static int -num_digits (int value) -{ - /* Perhaps simpler to use log10 for this, but doing it this way avoids - using floating point. */ - gcc_assert (value >= 0); - - if (value == 0) - return 1; - - int digits = 0; - while (value > 0) - { - digits++; - value /= 10; - } - return digits; -} - - -#if CHECKING_P - -/* Selftest for num_digits. */ - -static void -test_num_digits () -{ - ASSERT_EQ (1, num_digits (0)); - ASSERT_EQ (1, num_digits (9)); - ASSERT_EQ (2, num_digits (10)); - ASSERT_EQ (2, num_digits (99)); - ASSERT_EQ (3, num_digits (100)); - ASSERT_EQ (3, num_digits (999)); - ASSERT_EQ (4, num_digits (1000)); - ASSERT_EQ (4, num_digits (9999)); - ASSERT_EQ (5, num_digits (10000)); - ASSERT_EQ (5, num_digits (99999)); - ASSERT_EQ (6, num_digits (100000)); - ASSERT_EQ (6, num_digits (999999)); - ASSERT_EQ (7, num_digits (1000000)); - ASSERT_EQ (7, num_digits (9999999)); - ASSERT_EQ (8, num_digits (10000000)); - ASSERT_EQ (8, num_digits (99999999)); -} - -#endif /* #if CHECKING_P */ - /* Implementation of class layout. */ /* Constructor for class layout. @@ -3761,7 +3711,6 @@ void diagnostic_show_locus_c_tests () { test_line_span (); - test_num_digits (); test_layout_range_for_single_point (); test_layout_range_for_single_line (); diff --git a/gcc/diagnostic.c b/gcc/diagnostic.c index a572c084aac..08d40b87e2c 100644 --- a/gcc/diagnostic.c +++ b/gcc/diagnostic.c @@ -1024,6 +1024,27 @@ diagnostic_report_diagnostic (diagnostic_context *context, return true; } +/* Get the number of digits in the decimal representation of VALUE. */ + +int +num_digits (int value) +{ + /* Perhaps simpler to use log10 for this, but doing it this way avoids + using floating point. */ + gcc_assert (value >= 0); + + if (value == 0) + return 1; + + int digits = 0; + while (value > 0) + { + digits++; + value /= 10; + } + return digits; +} + /* Given a partial pathname as input, return another pathname that shares no directory elements with the pathname of __FILE__. This is used by fancy_abort() to print `Internal compiler error in expr.c' @@ -1774,6 +1795,29 @@ test_diagnostic_get_location_text () progname = old_progname; } +/* Selftest for num_digits. */ + +static void +test_num_digits () +{ + ASSERT_EQ (1, num_digits (0)); + ASSERT_EQ (1, num_digits (9)); + ASSERT_EQ (2, num_digits (10)); + ASSERT_EQ (2, num_digits (99)); + ASSERT_EQ (3, num_digits (100)); + ASSERT_EQ (3, num_digits (999)); + ASSERT_EQ (4, num_digits (1000)); + ASSERT_EQ (4, num_digits (9999)); + ASSERT_EQ (5, num_digits (10000)); + ASSERT_EQ (5, num_digits (99999)); + ASSERT_EQ (6, num_digits (100000)); + ASSERT_EQ (6, num_digits (999999)); + ASSERT_EQ (7, num_digits (1000000)); + ASSERT_EQ (7, num_digits (9999999)); + ASSERT_EQ (8, num_digits (10000000)); + ASSERT_EQ (8, num_digits (99999999)); +} + /* Run all of the selftests within this file. */ void @@ -1785,6 +1829,8 @@ diagnostic_c_tests () test_print_parseable_fixits_remove (); test_print_parseable_fixits_replace (); test_diagnostic_get_location_text (); + test_num_digits (); + } } // namespace selftest diff --git a/gcc/diagnostic.h b/gcc/diagnostic.h index 3498a9ba7bb..a48fe3f9a97 100644 --- a/gcc/diagnostic.h +++ b/gcc/diagnostic.h @@ -401,5 +401,7 @@ extern char *file_name_as_prefix (diagnostic_context *, const char *); extern char *build_message_string (const char *, ...) ATTRIBUTE_PRINTF_1; +/* Compute the number of digits in the decimal representation of an integer. */ +extern int num_digits (int); #endif /* ! GCC_DIAGNOSTIC_H */ diff --git a/gcc/input.c b/gcc/input.c index 9fb6e72421f..d63b5572db4 100644 --- a/gcc/input.c +++ b/gcc/input.c @@ -21,6 +21,7 @@ along with GCC; see the file COPYING3. If not see #include "system.h" #include "coretypes.h" #include "intl.h" +#include "diagnostic.h" #include "diagnostic-core.h" #include "selftest.h" #include "cpplib.h" @@ -1067,6 +1068,37 @@ dump_location_info (FILE *stream) map->m_column_and_range_bits - map->m_range_bits); fprintf (stream, " range bits: %i\n", map->m_range_bits); + const char * reason; + switch (map->reason) { + case LC_ENTER: + reason = "LC_ENTER"; + break; + case LC_LEAVE: + reason = "LC_LEAVE"; + break; + case LC_RENAME: + reason = "LC_RENAME"; + break; + case LC_RENAME_VERBATIM: + reason = "LC_RENAME_VERBATIM"; + break; + case LC_ENTER_MACRO: + reason = "LC_RENAME_MACRO"; + break; + default: + reason = "Unknown"; + } + fprintf (stream, " reason: %d (%s)\n", map->reason, reason); + + const line_map_ordinary *includer_map + = linemap_included_from_linemap (line_table, map); + fprintf (stream, " included from location: %d", + linemap_included_from (map)); + if (includer_map) { + fprintf (stream, " (in ordinary map %d)", + int (includer_map - line_table->info_ordinary.maps)); + } + fprintf (stream, "\n"); /* Render the span of source lines that this "map" covers. */ for (source_location loc = MAP_START_LOCATION (map); @@ -1100,7 +1132,14 @@ dump_location_info (FILE *stream) if (max_col > line_text.length ()) max_col = line_text.length () + 1; - int indent = 14 + strlen (exploc.file); + int len_lnum = num_digits (exploc.line); + if (len_lnum < 3) + len_lnum = 3; + int len_loc = num_digits (loc); + if (len_loc < 5) + len_loc = 5; + + int indent = 6 + strlen (exploc.file) + len_lnum + len_loc; /* Thousands. */ if (end_location > 999) diff --git a/libcpp/location-example.txt b/libcpp/location-example.txt index 14b5c2e284a..dc448b0493e 100644 --- a/libcpp/location-example.txt +++ b/libcpp/location-example.txt @@ -33,8 +33,12 @@ ORDINARY MAP: 0 source_location interval: 32 <= loc < 64 file: test.c starting at line: 1 - column bits: 12 + column and range bits: 12 + column bits: 7 range bits: 5 + reason: 0 (LC_ENTER) + included from map: -1 + included from location: 0 test.c: 1|loc: 32|#include "test.h" |69269258258148147 |46802468024680246 @@ -43,186 +47,235 @@ ORDINARY MAP: 1 source_location interval: 64 <= loc < 96 file: starting at line: 0 + column and range bits: 0 column bits: 0 range bits: 0 + reason: 2 (LC_RENAME) + included from map: -1 + included from location: 0 ORDINARY MAP: 2 source_location interval: 96 <= loc < 128 file: starting at line: 0 + column and range bits: 0 column bits: 0 range bits: 0 + reason: 2 (LC_RENAME) + included from map: -1 + included from location: 0 ORDINARY MAP: 3 - source_location interval: 128 <= loc < 160128 + source_location interval: 128 <= loc < 250240 file: /usr/include/stdc-predef.h starting at line: 1 - column bits: 12 + column and range bits: 12 + column bits: 7 range bits: 5 + reason: 0 (LC_ENTER) + included from map: 2 + included from location: 127 (contents of /usr/include/stdc-predef.h snipped for brevity) ORDINARY MAP: 4 - source_location interval: 160128 <= loc < 160160 + source_location interval: 250240 <= loc < 250272 file: starting at line: 32 - column bits: 12 + column and range bits: 12 + column bits: 7 range bits: 5 + reason: 1 (LC_LEAVE) + included from map: -1 + included from location: 0 ORDINARY MAP: 5 - source_location interval: 160160 <= loc < 164256 + source_location interval: 250272 <= loc < 254368 file: test.c starting at line: 1 - column bits: 12 + column and range bits: 12 + column bits: 7 range bits: 5 -test.c: 1|loc:160160|#include "test.h" - |00000000000000000 - |12223334445556667 - |92582581481470470 - |24680246802468024 + reason: 2 (LC_RENAME) + included from map: -1 + included from location: 0 +test.c: 1|loc:250272|#include "test.h" + |00000000000000000 + |33344445556667778 + |03603692692582581 + |46802468024680246 ORDINARY MAP: 6 - source_location interval: 164256 <= loc < 173280 + source_location interval: 254368 <= loc < 266720 file: test.h starting at line: 1 - column bits: 12 + column and range bits: 12 + column bits: 7 range bits: 5 -test.h: 1|loc:164256|extern int foo (); - |444444444444444444 - |233344455566677788 - |825814814704703603 - |802468024680246802 -test.h: 2|loc:168352| - | - | - | - | -test.h: 3|loc:172448|#define PLUS(A, B) A + B - |222222222222222223333333 - |455566677788889990001112 - |814704703603692692582581 - |024680246802468024680246 + reason: 0 (LC_ENTER) + included from map: 5 + included from location: 250272 +test.h: 1|loc:254368|extern int foo (); + |444444444444444444 + |444455566677788899 + |036926925825814814 + |024680246802468024 +test.h: 2|loc:258464| + | + | + | + | +test.h: 3|loc:262560|#define PLUS(A, B) A + B + |222222222222233333333333 + |566677788899900011122223 + |925825814814704703603692 + |246802468024680246802468 +test.h: 4|loc:266656| + | + | + | + | ORDINARY MAP: 7 - source_location interval: 173280 <= loc < 202016 + source_location interval: 266720 <= loc < 299520 file: test.c starting at line: 2 - column bits: 12 + column and range bits: 12 + column bits: 7 range bits: 5 -test.c: 2|loc:173280| - | - | - | - | -test.c: 3|loc:177376|int - |777 - |444 - |047 - |802 -test.c: 4|loc:181472|main (int argc, char **argv) - |1111111111111111222222222222 - |5556666777888999000111222333 - |0360369269258258148147047036 - |4680246802468024680246802468 -test.c: 5|loc:185568|{ - |5 - |6 - |0 - |0 -test.c: 6|loc:189664| int a = PLUS (1,2); - |999999999900000000000 - |677788899900011122233 - |926925825814814704703 - |680246802468024680246 -test.c: 7|loc:193760| int b = PLUS (3,4); - |333333344444444444444 - |788899900011122233344 - |925825814814704703603 - |246802468024680246802 -test.c: 8|loc:197856| return 0; - |77778888888 - |89990001112 - |82581481470 - |80246802468 -test.c: 9|loc:201952|} - |1 - |9 - |8 - |4 + reason: 1 (LC_LEAVE) + included from map: -1 + included from location: 0 +test.c: 2|loc:266720| + | + | + | + | +test.c: 3|loc:270816|int + |000 + |889 + |481 + |802 +test.c: 4|loc:274912|main (int argc, char **argv) + |4455555555555555555555555555 + |9900011122223334445556667778 + |4704703603692692582581481470 + |4680246802468024680246802468 +test.c: 5|loc:279008|{ + |9 + |0 + |4 + |0 +test.c: 6|loc:283104| int a = PLUS (1,2); + |333333333333333333333 + |112222333444555666777 + |360369269258258148147 + |680246802468024680246 +test.c: 7|loc:287200| int b = PLUS (3,4); + |777777777777777777777 + |222333444555666777888 + |369269258258148147047 + |246802468024680246802 +test.c: 8|loc:291296| return 0; + |11111111111 + |33344455566 + |26925825814 + |80246802468 +test.c: 9|loc:295392|} + |5 + |4 + |2 + |4 +test.c: 10|loc:299488| + | + | + | + | UNALLOCATED LOCATIONS - source_location interval: 202016 <= loc < 2147483633 + source_location interval: 299520 <= loc < 2147483632 -MACRO 1: PLUS (7 tokens) - source_location interval: 2147483633 <= loc < 2147483640 -test.c:7:11: note: expansion point is location 194115 - int b = PLUS (3,4); - ^~~~ +MACRO 3: PLUS (7 tokens) + source_location interval: 2147483632 <= loc < 2147483639 +test.c:7:11: note: expansion point is location 287555 + 7 | int b = PLUS (3,4); + | ^~~~ + map->start_location: 2147483632 + macro_locations: + 0: 287744, 263200 +test.c:7:17: note: token 0 has x-location == 287744 + 7 | int b = PLUS (3,4); + | ^ +test.c:7:17: note: token 0 has y-location == 263200 + 1: 263264, 263264 +In file included from test.c:1: +test.h:3:22: note: token 1 has x-location == y-location == 263264 + 3 | #define PLUS(A, B) A + B + | ^ + 2: 287808, 263328 +test.c:7:19: note: token 2 has x-location == 287808 + 7 | int b = PLUS (3,4); + | ^ +test.c:7:19: note: token 2 has y-location == 263328 + 3: 0, 0 +cc1: note: token 3 has x-location == y-location == 0 + 4: 0, 0 +cc1: note: token 4 has x-location == y-location == 0 + 5: 0, 0 +cc1: note: token 5 has x-location == y-location == 0 + 6: 0, 0 +cc1: note: token 6 has x-location == y-location == 0 + +MACRO 2: PLUS (7 tokens) + source_location interval: 2147483639 <= loc < 2147483646 +test.c:6:11: note: expansion point is location 283459 + 6 | int a = PLUS (1,2); + | ^~~~ + map->start_location: 2147483639 + macro_locations: + 0: 283648, 263200 +test.c:6:17: note: token 0 has x-location == 283648 + 6 | int a = PLUS (1,2); + | ^ +test.c:6:17: note: token 0 has y-location == 263200 + 1: 263264, 263264 +In file included from test.c:1: +test.h:3:22: note: token 1 has x-location == y-location == 263264 + 3 | #define PLUS(A, B) A + B + | ^ + 2: 283712, 263328 +test.c:6:19: note: token 2 has x-location == 283712 + 6 | int a = PLUS (1,2); + | ^ +test.c:6:19: note: token 2 has y-location == 263328 + 3: 0, 0 +cc1: note: token 3 has x-location == y-location == 0 + 4: 0, 0 +cc1: note: token 4 has x-location == y-location == 0 + 5: 0, 0 +cc1: note: token 5 has x-location == y-location == 0 + 6: 0, 0 +cc1: note: token 6 has x-location == y-location == 0 - map->start_location: 2147483633 +MACRO 1: __GCC_IEC_559_COMPLEX (1 tokens) + source_location interval: 2147483646 <= loc < 2147483647 +In file included from :31: +/usr/include/stdc-predef.h:45:6: note: expansion point is location 180564 + 45 | # if __GCC_IEC_559_COMPLEX > 0 + | ^~~~~~~~~~~~~~~~~~~~~ + map->start_location: 2147483646 macro_locations: - 0: 194304, 173088 -test.c:7:17: note: token 0 has x-location == 194304 - int b = PLUS (3,4); - ^ - -test.c:7:17: note: token 0 has y-location == 173088 - 1: 173152, 173152 -In file included from test.c:1:0: -test.h:3:22: note: token 1 has x-location == y-location == 173152 - #define PLUS(A, B) A + B - ^ - - 2: 194368, 173216 -test.c:7:19: note: token 2 has x-location == 194368 - int b = PLUS (3,4); - ^ - -test.c:7:19: note: token 2 has y-location == 173216 - 3: 0, 2947526575 -cc1: note: token 3 has x-location == 0 -cc1: note: token 3 has y-location == 2947526575 - 4: 2947526575, 2947526575 -x-location == y-location == 2947526575 encodes token # 800042942 - 5: 2947526575, 2947526575 -x-location == y-location == 2947526575 encodes token # 800042942 - 6: 2947526575, 2947526575 -x-location == y-location == 2947526575 encodes token # 800042942 - -MACRO 0: PLUS (7 tokens) - source_location interval: 2147483640 <= loc < 2147483647 -test.c:6:11: note: expansion point is location 190019 - int a = PLUS (1,2); - ^~~~ - - map->start_location: 2147483640 + 0: 1, 1 +: note: token 0 has x-location == y-location == 1 + +MACRO 0: __GCC_IEC_559 (1 tokens) + source_location interval: 2147483647 <= loc < 2147483648 +/usr/include/stdc-predef.h:37:6: note: expansion point is location 147788 + 37 | # if __GCC_IEC_559 > 0 + | ^~~~~~~~~~~~~ + map->start_location: 2147483647 macro_locations: - 0: 190208, 173088 -test.c:6:17: note: token 0 has x-location == 190208 - int a = PLUS (1,2); - ^ - -test.c:6:17: note: token 0 has y-location == 173088 - 1: 173152, 173152 -In file included from test.c:1:0: -test.h:3:22: note: token 1 has x-location == y-location == 173152 - #define PLUS(A, B) A + B - ^ - - 2: 190272, 173216 -test.c:6:19: note: token 2 has x-location == 190272 - int a = PLUS (1,2); - ^ - -test.c:6:19: note: token 2 has y-location == 173216 - 3: 0, 2947526575 -cc1: note: token 3 has x-location == 0 -cc1: note: token 3 has y-location == 2947526575 - 4: 2947526575, 2947526575 -x-location == y-location == 2947526575 encodes token # 800042935 - 5: 2947526575, 2947526575 -x-location == y-location == 2947526575 encodes token # 800042935 - 6: 2947526575, 2947526575 -x-location == y-location == 2947526575 encodes token # 800042935 + 0: 1, 1 +: note: token 0 has x-location == y-location == 1 MAX_SOURCE_LOCATION source_location interval: 2147483647 <= loc < 2147483648