From patchwork Fri Oct 23 20:41:49 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Malcolm X-Patchwork-Id: 535245 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]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4CF66141364 for ; Sat, 24 Oct 2015 07:24:30 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=uy2BvDKY; dkim-atps=neutral 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; q=dns; s= default; b=yRWMtAY4NVAWMmk3IinOxe0rk2Mn5vKTcidxsERo9X9oPNYzfchWU j90ZxkW3Rzdl7Ab60YGsIHmu+kDiQY1tZx+Zh2FadXOzq7kz+vatD8y/PisK3mcv XU/6VUEw0+nKFUzenI9vTtoYD6RMlk7OfoZabD/B7BmNsRgN9RL7D8= 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; s= default; bh=qyY91lvcMm/a4nfiDKjZoTmqd8c=; b=uy2BvDKYCFoudl3e9Ksq JipFkyxc1mUVG7s/8kdwzLJ2MwTGJSC0BDKpSuzr2I2jYkydFQwlHbwKYjngKe+m 3L12ceK2bbTbsNah/Que3BAoOcrjti40wzMDLwJ2hAwfkkqtQR1wy+61LBNwIl6z 4CiQiigPNsCMdMwWpkrtAz0= Received: (qmail 9332 invoked by alias); 23 Oct 2015 20:24:23 -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 9308 invoked by uid 89); 23 Oct 2015 20:24:22 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.4 required=5.0 tests=AWL, BAYES_00, KAM_ASCII_DIVIDERS, RP_MATCHES_RCVD, SPF_HELO_PASS autolearn=no version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Fri, 23 Oct 2015 20:24:21 +0000 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (Postfix) with ESMTPS id 8052EAB2 for ; Fri, 23 Oct 2015 20:24:20 +0000 (UTC) Received: from c64.redhat.com (vpn-230-149.phx2.redhat.com [10.3.230.149]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t9NKOJgQ007382; Fri, 23 Oct 2015 16:24:20 -0400 From: David Malcolm To: gcc-patches@gcc.gnu.org Cc: David Malcolm Subject: [PATCH 01/10] Improvements to description of source_location in line-map.h Date: Fri, 23 Oct 2015 16:41:49 -0400 Message-Id: <1445632918-29617-2-git-send-email-dmalcolm@redhat.com> In-Reply-To: <1445632918-29617-1-git-send-email-dmalcolm@redhat.com> References: <1442957171-22904-1-git-send-email-dmalcolm@redhat.com> <1445632918-29617-1-git-send-email-dmalcolm@redhat.com> X-IsSubscribed: yes libcpp/ChangeLog: * include/line-map.h (source_location): In the table in the descriptive comment, show UNKNOWN_LOCATION, BUILTINS_LOCATION, LINE_MAP_MAX_LOCATION_WITH_COLS, LINE_MAP_MAX_SOURCE_LOCATION. Add notes about ad-hoc values. --- libcpp/include/line-map.h | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/libcpp/include/line-map.h b/libcpp/include/line-map.h index bc747c1..30bad87 100644 --- a/libcpp/include/line-map.h +++ b/libcpp/include/line-map.h @@ -59,8 +59,10 @@ typedef unsigned int linenum_type; Actual | Value | Meaning -----------+-------------------------------+------------------------------- - 0x00000000 | | Reserved for use by libcpp - 0x00000001 | RESERVED_LOCATION_COUNT - 1 | Reserved for use by libcpp + 0x00000000 | UNKNOWN_LOCATION (gcc/input.h)| Unknown/invalid location. + -----------+-------------------------------+------------------------------- + 0x00000001 | BUILTINS_LOCATION | The location for declarations + | (gcc/input.h) | in "" -----------+-------------------------------+------------------------------- 0x00000002 | RESERVED_LOCATION_COUNT | The first location to be | (also | handed out, and the @@ -94,6 +96,16 @@ typedef unsigned int linenum_type; | | (unallocated integers) | + 0x60000000 | LINE_MAP_MAX_LOCATION_WITH_COLS + | Beyond this point, ordinary linemaps have 0 bits per column: + | each increment of the value corresponds to a new source line. + | + 0x70000000 | LINE_MAP_MAX_SOURCE_LOCATION + | Beyond the point, we give up on ordinary maps; attempts to + | create locations in them lead to UNKNOWN_LOCATION (0). + | + | (unallocated integers) + | | Macro maps grow this way | ^^^^^^^^^^^^^^^^^^^^^^^^ | | @@ -107,10 +119,11 @@ typedef unsigned int linenum_type; | macromap[1]->start_location | Start of macro map 1 -----------+-------------------------------+------------------------------- | macromap[0]->start_location | Start of macro map 0 - 0x7fffffff | MAX_SOURCE_LOCATION | + 0x7fffffff | MAX_SOURCE_LOCATION | Also used as a mask for + | | accessing the ad-hoc data table -----------+-------------------------------+------------------------------- - 0x80000000 | Start of ad-hoc values | - ... | | + 0x80000000 | Start of ad-hoc values; the lower 31 bits are used as an index + ... | into the line_table->location_adhoc_data_map.data array. 0xffffffff | UINT_MAX | -----------+-------------------------------+-------------------------------