From patchwork Tue Sep 27 04:08:41 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Tromey X-Patchwork-Id: 16063 Received: (qmail 104481 invoked by alias); 27 Sep 2016 04:51:26 -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 104383 invoked by uid 89); 27 Sep 2016 04:51:25 -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, RCVD_IN_DNSWL_NONE, RCVD_IN_SORBS_SPAM, SPF_PASS autolearn=no version=3.3.2 spammy= X-HELO: gproxy4-pub.mail.unifiedlayer.com Received: from gproxy4-pub.mail.unifiedlayer.com (HELO gproxy4-pub.mail.unifiedlayer.com) (69.89.23.142) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with SMTP; Tue, 27 Sep 2016 04:51:24 +0000 Received: (qmail 14687 invoked by uid 0); 27 Sep 2016 04:51:23 -0000 Received: from unknown (HELO cmgw4) (10.0.90.85) by gproxy4.mail.unifiedlayer.com with SMTP; 27 Sep 2016 04:51:23 -0000 Received: from box522.bluehost.com ([74.220.219.122]) by cmgw4 with id oUrL1t00P2f2jeq01UrPJm; Mon, 26 Sep 2016 22:51:23 -0600 X-Authority-Analysis: v=2.1 cv=Hq7lRSjS c=1 sm=1 tr=0 a=GsOEXm/OWkKvwdLVJsfwcA==:117 a=GsOEXm/OWkKvwdLVJsfwcA==:17 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=GW1xBdLrtEIA:10 a=zstS-IiYAAAA:8 a=XoqgwiYk4bpxDoROsTYA:9 a=wEFBw2i-LLty18Gj:21 a=3ruQdt_-oh0HTYY4:21 a=4G6NA9xxw8l3yy4pmD5M:22 Received: from 71-218-192-86.hlrn.qwest.net ([71.218.192.86]:56110 helo=bapiya.Home) by box522.bluehost.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.86_1) (envelope-from ) id 1bojhV-0006Nj-HJ; Mon, 26 Sep 2016 22:09:01 -0600 From: Tom Tromey To: gdb-patches@sourceware.org Cc: Tom Tromey Subject: [RFA 13/22] Remove unnecessary cleanup from stabsread.c Date: Mon, 26 Sep 2016 22:08:41 -0600 Message-Id: <1474949330-4307-14-git-send-email-tom@tromey.com> In-Reply-To: <1474949330-4307-1-git-send-email-tom@tromey.com> References: <1474949330-4307-1-git-send-email-tom@tromey.com> X-BWhitelist: no X-Exim-ID: 1bojhV-0006Nj-HJ X-Source-Sender: 71-218-192-86.hlrn.qwest.net (bapiya.Home) [71.218.192.86]:56110 X-Source-Auth: tom+tromey.com X-Email-Count: 23 X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTIyLmJsdWVob3N0LmNvbQ== This removes an unnecessary cleanup from stabsread.c. It's unnecessary because nothing between the cleanup creation and use makes a cleanup. 2016-09-26 Tom Tromey * stabsread.c (read_struct_type): Remove unnecessary cleanup. --- gdb/ChangeLog | 4 ++++ gdb/stabsread.c | 9 +-------- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index d3b8a45..476dbb3 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,9 @@ 2016-09-26 Tom Tromey + * stabsread.c (read_struct_type): Remove unnecessary cleanup. + +2016-09-26 Tom Tromey + * tracepoint.c (trace_dump_command): Remove unnecessary null_cleanup. diff --git a/gdb/stabsread.c b/gdb/stabsread.c index e8ebadd..cc2fef3 100644 --- a/gdb/stabsread.c +++ b/gdb/stabsread.c @@ -3507,7 +3507,6 @@ static struct type * read_struct_type (char **pp, struct type *type, enum type_code type_code, struct objfile *objfile) { - struct cleanup *back_to; struct field_info fi; fi.list = NULL; @@ -3533,8 +3532,6 @@ read_struct_type (char **pp, struct type *type, enum type_code type_code, return type; } - back_to = make_cleanup (null_cleanup, 0); - INIT_CPLUS_SPECIFIC (type); TYPE_CODE (type) = type_code; TYPE_STUB (type) = 0; @@ -3546,10 +3543,7 @@ read_struct_type (char **pp, struct type *type, enum type_code type_code, TYPE_LENGTH (type) = read_huge_number (pp, 0, &nbits, 0); if (nbits != 0) - { - do_cleanups (back_to); - return error_type (pp, objfile); - } + return error_type (pp, objfile); set_length_in_type_chain (type); } @@ -3568,7 +3562,6 @@ read_struct_type (char **pp, struct type *type, enum type_code type_code, type = error_type (pp, objfile); } - do_cleanups (back_to); return (type); }