From patchwork Fri Jun 8 04:52:32 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Tromey X-Patchwork-Id: 27707 Received: (qmail 106376 invoked by alias); 8 Jun 2018 04:52:40 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 106324 invoked by uid 89); 8 Jun 2018 04:52:39 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-26.3 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_HELO_PASS autolearn=ham version=3.3.2 spammy= X-HELO: gateway23.websitewelcome.com Received: from gateway23.websitewelcome.com (HELO gateway23.websitewelcome.com) (192.185.49.180) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 08 Jun 2018 04:52:37 +0000 Received: from cm11.websitewelcome.com (cm11.websitewelcome.com [100.42.49.5]) by gateway23.websitewelcome.com (Postfix) with ESMTP id 3A2EBF984 for ; Thu, 7 Jun 2018 23:52:36 -0500 (CDT) Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with SMTP id R9O7fqADWRPojR9O8fVhIX; Thu, 07 Jun 2018 23:52:36 -0500 X-Authority-Reason: nr=8 Received: from 75-166-19-45.hlrn.qwest.net ([75.166.19.45]:35836 helo=bapiya.Home) by box5379.bluehost.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.91) (envelope-from ) id 1fR9O7-002hNb-GH; Thu, 07 Jun 2018 23:52:35 -0500 From: Tom Tromey To: gdb-patches@sourceware.org Cc: Tom Tromey Subject: [RFA] Remove a VEC from dwarf2read.c Date: Thu, 7 Jun 2018 22:52:32 -0600 Message-Id: <20180608045232.19342-1-tom@tromey.com> X-BWhitelist: no X-Source-L: No X-Exim-ID: 1fR9O7-002hNb-GH X-Source-Sender: 75-166-19-45.hlrn.qwest.net (bapiya.Home) [75.166.19.45]:35836 X-Source-Auth: tom+tromey.com X-Email-Count: 1 X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTM3OS5ibHVlaG9zdC5jb20= X-Local-Domain: yes This removes a VEC from dwarf2read.c, replacing it with a std::vector. Tested by the buildbot. gdb/ChangeLog 2018-06-07 Tom Tromey * dwarf2read.c (process_cu_includes): Update. (process_full_comp_unit): Update. * dwarf2read.h (struct dwarf2_per_objfile) : Now a std::vector. --- gdb/ChangeLog | 7 +++++++ gdb/dwarf2read.c | 12 +++--------- gdb/dwarf2read.h | 2 +- 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c index 1cabfbb0d45..7f1857930b1 100644 --- a/gdb/dwarf2read.c +++ b/gdb/dwarf2read.c @@ -10217,19 +10217,13 @@ compute_compunit_symtab_includes (struct dwarf2_per_cu_data *per_cu) static void process_cu_includes (struct dwarf2_per_objfile *dwarf2_per_objfile) { - int ix; - struct dwarf2_per_cu_data *iter; - - for (ix = 0; - VEC_iterate (dwarf2_per_cu_ptr, dwarf2_per_objfile->just_read_cus, - ix, iter); - ++ix) + for (struct dwarf2_per_cu_data *iter : dwarf2_per_objfile->just_read_cus) { if (! iter->is_debug_types) compute_compunit_symtab_includes (iter); } - VEC_free (dwarf2_per_cu_ptr, dwarf2_per_objfile->just_read_cus); + dwarf2_per_objfile->just_read_cus.clear (); } /* Generate full symbol information for PER_CU, whose DIEs have @@ -10337,7 +10331,7 @@ process_full_comp_unit (struct dwarf2_per_cu_data *per_cu, } /* Push it for inclusion processing later. */ - VEC_safe_push (dwarf2_per_cu_ptr, dwarf2_per_objfile->just_read_cus, per_cu); + dwarf2_per_objfile->just_read_cus.push_back (per_cu); } /* Generate full symbol information for type unit PER_CU, whose DIEs have diff --git a/gdb/dwarf2read.h b/gdb/dwarf2read.h index fbac7171deb..74335d77db0 100644 --- a/gdb/dwarf2read.h +++ b/gdb/dwarf2read.h @@ -233,7 +233,7 @@ public: htab_t die_type_hash {}; /* The CUs we recently read. */ - VEC (dwarf2_per_cu_ptr) *just_read_cus = NULL; + std::vector just_read_cus; /* Table containing line_header indexed by offset and offset_in_dwz. */ htab_t line_header_hash {};