From patchwork Sun Oct 26 04:49:47 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Doug Evans X-Patchwork-Id: 3375 Received: (qmail 677 invoked by alias); 26 Oct 2014 04:50:42 -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 663 invoked by uid 89); 26 Oct 2014 04:50:40 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=AWL, BAYES_00, FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-pa0-f47.google.com Received: from mail-pa0-f47.google.com (HELO mail-pa0-f47.google.com) (209.85.220.47) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Sun, 26 Oct 2014 04:50:37 +0000 Received: by mail-pa0-f47.google.com with SMTP id kx10so3392553pab.6 for ; Sat, 25 Oct 2014 21:50:35 -0700 (PDT) X-Received: by 10.70.10.33 with SMTP id f1mr15404155pdb.1.1414299035562; Sat, 25 Oct 2014 21:50:35 -0700 (PDT) Received: from seba.sebabeach.org.gmail.com (173-13-178-50-sfba.hfc.comcastbusiness.net. [173.13.178.50]) by mx.google.com with ESMTPSA id fz1sm7416007pbb.80.2014.10.25.21.50.34 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 25 Oct 2014 21:50:34 -0700 (PDT) From: Doug Evans To: gdb-patches@sourceware.org Subject: [COMMITTED PATCH] Remove second (nested) copy of local var child_die. Date: Sat, 25 Oct 2014 21:49:47 -0700 Message-ID: MIME-Version: 1.0 X-IsSubscribed: yes Hi. This function was a bit confusing to read given the outer child_die was initialized way early and used way late. Committed. 2014-10-25 Doug Evans * dwarf2read.c (process_structure_scope): Remove second (nested) copy of local var child_die. diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c index eccd11a..3f2a127 100644 --- a/gdb/dwarf2read.c +++ b/gdb/dwarf2read.c @@ -13016,7 +13016,7 @@ static void process_structure_scope (struct die_info *die, struct dwarf2_cu *cu) { struct objfile *objfile = cu->objfile; - struct die_info *child_die = die->child; + struct die_info *child_die; struct type *type; type = get_die_type (die, cu); @@ -13026,7 +13026,6 @@ process_structure_scope (struct die_info *die, struct dwarf2_cu *cu) if (die->child != NULL && ! die_is_declaration (die, cu)) { struct field_info fi; - struct die_info *child_die; VEC (symbolp) *template_args = NULL; struct cleanup *back_to = make_cleanup (null_cleanup, 0); @@ -13197,6 +13196,8 @@ process_structure_scope (struct die_info *die, struct dwarf2_cu *cu) current die is a declaration. Normally, of course, a declaration won't have any children at all. */ + child_die = die->child; + while (child_die != NULL && child_die->tag) { if (child_die->tag == DW_TAG_member