From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gateway22.websitewelcome.com (gateway22.websitewelcome.com [192.185.47.129]) by sourceware.org (Postfix) with ESMTPS id 1EB5139B8C39 for ; Wed, 28 Apr 2021 01:01:44 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 1EB5139B8C39 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=tromey.com Authentication-Results: sourceware.org; spf=fail smtp.mailfrom=tom@tromey.com Received: from cm16.websitewelcome.com (cm16.websitewelcome.com [100.42.49.19]) by gateway22.websitewelcome.com (Postfix) with ESMTP id BD9CD47AF for ; Tue, 27 Apr 2021 20:01:42 -0500 (CDT) Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with SMTP id bYaElHawub8LybYaElD6mJ; Tue, 27 Apr 2021 20:01:42 -0500 X-Authority-Reason: nr=8 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tromey.com; s=default; h=Content-Transfer-Encoding:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=5fU7FwOa+xNawyhRd+hUoIZxaAYf0lcAW7Wo28XHJ+w=; b=kxhVgbG/N4qM6EDmpcOmmrm1WY x3OY9lHgxQzmPIJnu0X3zq/deNysEiYsong712TEOA8Pk217d08e2aJdB09a60vONsyvQERzMzrew vV8ruT8h6mLUejvDPBa0HiU2t; Received: from 97-122-70-176.hlrn.qwest.net ([97.122.70.176]:32966 helo=localhost.localdomain) by box5379.bluehost.com with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94) (envelope-from ) id 1lbYaE-003tiR-HQ; Tue, 27 Apr 2021 19:01:42 -0600 From: Tom Tromey To: gcc-patches@gcc.gnu.org Cc: Tom Tromey Subject: [PATCH v2 12/21] libcc1: use foreach Date: Tue, 27 Apr 2021 19:01:10 -0600 Message-Id: <20210428010119.806184-13-tom@tromey.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20210428010119.806184-1-tom@tromey.com> References: <20210428010119.806184-1-tom@tromey.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - box5379.bluehost.com X-AntiAbuse: Original Domain - gcc.gnu.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - tromey.com X-BWhitelist: no X-Source-IP: 97.122.70.176 X-Source-L: No X-Exim-ID: 1lbYaE-003tiR-HQ X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: 97-122-70-176.hlrn.qwest.net (localhost.localdomain) [97.122.70.176]:32966 X-Source-Auth: tom+tromey.com X-Email-Count: 13 X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTM3OS5ibHVlaG9zdC5jb20= X-Local-Domain: yes X-Spam-Status: No, score=-3031.9 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, GIT_PATCH_0, JMQ_SPF_NEUTRAL, RCVD_IN_DNSWL_NONE, RCVD_IN_SBL_CSS, SPF_HELO_PASS, SPF_NEUTRAL, TXREP, URIBL_CSS, URIBL_CSS_A autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Apr 2021 01:01:47 -0000 This changes libcc1 to ues foreach in a couple of spots. libcc1/ChangeLog 2021-04-27 Tom Tromey * libcp1plugin.cc (plugin_context::mark): Use foreach. * libcc1plugin.cc (plugin_context::mark): Use foreach. --- libcc1/ChangeLog | 5 +++++ libcc1/libcc1plugin.cc | 13 +++++-------- libcc1/libcp1plugin.cc | 13 +++++-------- 3 files changed, 15 insertions(+), 16 deletions(-) diff --git a/libcc1/libcc1plugin.cc b/libcc1/libcc1plugin.cc index 65e748258f40..2a75faba7652 100644 --- a/libcc1/libcc1plugin.cc +++ b/libcc1/libcc1plugin.cc @@ -235,17 +235,14 @@ plugin_context::plugin_context (int fd) void plugin_context::mark () { - for (hash_table::iterator it = address_map.begin (); - it != address_map.end (); - ++it) + for (const auto &item : address_map) { - ggc_mark ((*it)->decl); - ggc_mark ((*it)->address); + ggc_mark (item->decl); + ggc_mark (item->address); } - for (hash_table< nofree_ptr_hash >::iterator - it = preserved.begin (); it != preserved.end (); ++it) - ggc_mark (&*it); + for (const auto &item : preserved) + ggc_mark (&item); } static void diff --git a/libcc1/libcp1plugin.cc b/libcc1/libcp1plugin.cc index 1fc8e269f075..3cbad5c6f021 100644 --- a/libcc1/libcp1plugin.cc +++ b/libcc1/libcp1plugin.cc @@ -225,17 +225,14 @@ plugin_context::plugin_context (int fd) void plugin_context::mark () { - for (hash_table::iterator it = address_map.begin (); - it != address_map.end (); - ++it) + for (const auto &item : address_map) { - ggc_mark ((*it)->decl); - ggc_mark ((*it)->address); + ggc_mark (item->decl); + ggc_mark (item->address); } - for (hash_table< nofree_ptr_hash >::iterator - it = preserved.begin (); it != preserved.end (); ++it) - ggc_mark (&*it); + for (const auto &item : preserved) + ggc_mark (&item); } static void -- 2.26.2