From patchwork Sun Oct 8 22:59:08 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Malcolm X-Patchwork-Id: 149785 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:a888:0:b0:403:3b70:6f57 with SMTP id x8csp1561068vqo; Sun, 8 Oct 2023 16:02:54 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH4swGy/Gzxs8Mrwtg89Tv4uqqma9OzohD9O7tpUlnMTi+J/H/DzJqIlqbEjaMB9BhkijrU X-Received: by 2002:a17:906:23e1:b0:9ae:53a2:4289 with SMTP id j1-20020a17090623e100b009ae53a24289mr13038459ejg.63.1696806174075; Sun, 08 Oct 2023 16:02:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696806174; cv=none; d=google.com; s=arc-20160816; b=sey0tCC9auvteuuwlKb83V9bOVbRfay2/R4V9clpdfTNvYFh6k95mG5O2I7Xs/Pt+4 3xWMQ/tHJ/50tq1NiQLTACc3Y0uxkq4kbDiPSK5boCBSJEppw62jUfaja/zKkxF9q9DC 59e8fhdZ5ytpUIfwLBPCu361166XDAW+5jWk/0lM04lCjKCY5waQg/WeR47LcGfnTBdb WYP8gHht/JvcBT9oT4tzgM5cBzTMJ6O1cX7MZCpLUb6atC9tAeis55s43xqYRAkZa9zs eiaf8kIkUnf9Vaj+gg2HijymANEjoMwpD/YEeN3bsEXkBVMlPihUlFdCP/jOaCMxLNa+ z4NQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:message-id:date:subject:cc:to:from:dkim-signature :dmarc-filter:delivered-to; bh=gsVu9W83Jl0MjiNl8CReSeAr/PEY3afTB+FjePuTdBY=; fh=NXemEfxTRbZtBxUkxR2ehQUaYlcDfMdzPkO8MChVQE4=; b=qjP3+jnAzudwV3s3fuOqvTdwoY8O3cnLlYVVjY1NN8N6375HkfddpdPlnK4BWLGwAN i+AA/43TEHtfdR9gikL523bKoLtmu6FSfKRgjd9clFJdu0l3Ky+uFvOtsoUZrBoAvD4Q /DrKg57wDyGGyo8EcHmN6fvo3HdqzzM9h160tIbtHX6XzNiJ1zypPmNSJaDGC33Ty/zb ZFWaEJbs12rtmIYlBZPKFPbV26kG7VgnmSkzq0+Og4b2URKdQ4IwOnLswbLP+oFhhkL9 8oMXdpNW0CBk0/w63533wrdGfh1Q84LuY/5G2M5m5/qqqTly8+u9H26Wa2P1hhikxP5t ERew== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=GzQjoxO0; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from server2.sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id ce8-20020a170906b24800b009b65b2be80asi4103602ejb.259.2023.10.08.16.02.53 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 08 Oct 2023 16:02:54 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=GzQjoxO0; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 222843853D02 for ; Sun, 8 Oct 2023 23:00:11 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id B7645385841C for ; Sun, 8 Oct 2023 22:59:11 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org B7645385841C Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1696805951; h=from:from: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; bh=gsVu9W83Jl0MjiNl8CReSeAr/PEY3afTB+FjePuTdBY=; b=GzQjoxO00QguybiVDnfmO1xBcr2n5kDl54RiXwiprtDLA5HECWiFJiYWXMSibNm2Jw7xCt j2lEtV4rUn1oWGZkxQjxS7py2HQqbUnH1lfSy5ljPsxIS8OfpE8TV6ZzLcO1hs5wBlRbU8 GTZQuTrocaca5vOLs0lV7S2CKf+/fPg= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-470-DTnCr_E_PmC7lZRJkzqVQg-1; Sun, 08 Oct 2023 18:59:09 -0400 X-MC-Unique: DTnCr_E_PmC7lZRJkzqVQg-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 2885E8002B2 for ; Sun, 8 Oct 2023 22:59:09 +0000 (UTC) Received: from t14s.localdomain.com (unknown [10.22.18.119]) by smtp.corp.redhat.com (Postfix) with ESMTP id D9CAF215670B; Sun, 8 Oct 2023 22:59:08 +0000 (UTC) From: David Malcolm To: gcc-patches@gcc.gnu.org Cc: David Malcolm Subject: [pushed] libcpp: eliminate LINEMAPS_{ORDINARY,MACRO}_MAPS Date: Sun, 8 Oct 2023 18:59:08 -0400 Message-Id: <20231008225908.783859-1-dmalcolm@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.6 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-11.4 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1779230230791842503 X-GMAIL-MSGID: 1779230230791842503 Successfully bootstrapped & regrtested on x86_64-pc-linux-gnu. Pushed to trunk as r14-4480-g0a0ceb7a72fe0b. libcpp/ChangeLog: * include/line-map.h (LINEMAPS_ORDINARY_MAPS): Delete. (LINEMAPS_MACRO_MAPS): Delete. * line-map.cc (linemap_tracks_macro_expansion_locs_p): Update for deletion of LINEMAPS_MACRO_MAPS. (linemap_get_statistics): Likewise. --- libcpp/include/line-map.h | 16 ---------------- libcpp/line-map.cc | 4 ++-- 2 files changed, 2 insertions(+), 18 deletions(-) diff --git a/libcpp/include/line-map.h b/libcpp/include/line-map.h index 30f2284b5d1..cb934e6b9b3 100644 --- a/libcpp/include/line-map.h +++ b/libcpp/include/line-map.h @@ -928,14 +928,6 @@ LINEMAPS_LAST_MAP (const line_maps *set, bool map_kind) LINEMAPS_USED (set, map_kind) - 1); } -/* Returns a pointer to the memory region where ordinary maps are - allocated in the line table SET. */ -inline line_map_ordinary * -LINEMAPS_ORDINARY_MAPS (const line_maps *set) -{ - return set->info_ordinary.maps; -} - /* Returns the INDEXth ordinary map. */ inline line_map_ordinary * LINEMAPS_ORDINARY_MAP_AT (const line_maps *set, int index) @@ -968,14 +960,6 @@ LINEMAPS_LAST_ORDINARY_MAP (const line_maps *set) return (line_map_ordinary *)LINEMAPS_LAST_MAP (set, false); } -/* Returns a pointer to the beginning of the region where macro maps - are allocated. */ -inline line_map_macro * -LINEMAPS_MACRO_MAPS (const line_maps *set) -{ - return set->info_macro.maps; -} - /* Returns the INDEXth macro map. */ inline line_map_macro * LINEMAPS_MACRO_MAP_AT (const line_maps *set, int index) diff --git a/libcpp/line-map.cc b/libcpp/line-map.cc index 385d54c53b7..cd173530149 100644 --- a/libcpp/line-map.cc +++ b/libcpp/line-map.cc @@ -738,7 +738,7 @@ linemap_module_restore (line_maps *set, unsigned lwm) bool linemap_tracks_macro_expansion_locs_p (const line_maps *set) { - return LINEMAPS_MACRO_MAPS (set) != NULL; + return set->info_macro.maps != nullptr; } /* Create a macro map. A macro map encodes source locations of tokens @@ -2076,7 +2076,7 @@ linemap_get_statistics (const line_maps *set, macro_maps_allocated_size = LINEMAPS_MACRO_ALLOCATED (set) * sizeof (struct line_map_macro); - for (cur_map = LINEMAPS_MACRO_MAPS (set); + for (cur_map = set->info_macro.maps; cur_map && cur_map <= LINEMAPS_LAST_MACRO_MAP (set); ++cur_map) {