From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gateway23.websitewelcome.com (gateway23.websitewelcome.com [192.185.49.180]) by sourceware.org (Postfix) with ESMTPS id B880D385E02F for ; Sun, 22 Mar 2020 18:45:29 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org B880D385E02F 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 cm14.websitewelcome.com (cm14.websitewelcome.com [100.42.49.7]) by gateway23.websitewelcome.com (Postfix) with ESMTP id 772A94042 for ; Sun, 22 Mar 2020 13:45:29 -0500 (CDT) Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with SMTP id G5bFjJdRIXVkQG5bFjaDrW; Sun, 22 Mar 2020 13:45:29 -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:Content-Type:MIME-Version:References: In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To: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=eWte/KbzutCZVP8pqyPg4u7MFWw4eZ9s0uqeLHPWFDc=; b=LQx4Q+0d63DZldrNlJOK5KHKsC 82bSFDNL+hUdAiOVWnUY0I1L9PLguQboAJYBSP6VEIXEyEhFWX2CyGiJLUhdvnqLWudJNQBDGphwR OA7PaZfwkb7r/fs/EzpYefdV7; Received: from 97-118-117-21.hlrn.qwest.net ([97.118.117.21]:48304 helo=bapiya.Home) by box5379.bluehost.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.92) (envelope-from ) id 1jG5bF-000LNS-8B; Sun, 22 Mar 2020 12:45:29 -0600 From: Tom Tromey To: gdb-patches@sourceware.org Cc: Tom Tromey Subject: [PATCH 18/22] Remove sibling_die Date: Sun, 22 Mar 2020 12:45:19 -0600 Message-Id: <20200322184523.28959-19-tom@tromey.com> X-Mailer: git-send-email 2.17.2 In-Reply-To: <20200322184523.28959-1-tom@tromey.com> References: <20200322184523.28959-1-tom@tromey.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 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 - sourceware.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.118.117.21 X-Source-L: No X-Exim-ID: 1jG5bF-000LNS-8B X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: 97-118-117-21.hlrn.qwest.net (bapiya.Home) [97.118.117.21]:48304 X-Source-Auth: tom+tromey.com X-Email-Count: 19 X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTM3OS5ibHVlaG9zdC5jb20= X-Local-Domain: yes X-Spam-Status: No, score=-23.0 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, JMQ_SPF_NEUTRAL, RCVD_IN_ABUSEAT, 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: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Mar 2020 18:45:33 -0000 The sibling_die helper function does not seem to add much value, considering that many other fields of die_info are directly accessed. So, this removes it. gdb/ChangeLog 2020-03-22 Tom Tromey * dwarf2/read.c (read_import_statement, read_file_scope) (read_type_unit_scope, inherit_abstract_dies, read_func_scope) (read_lexical_block_scope, read_call_site_scope) (dwarf2_get_subprogram_pc_bounds, get_scope_pc_bounds) (handle_struct_member_die, process_structure_scope) (update_enumeration_type_from_children) (process_enumeration_scope, read_array_type, read_common_block) (read_namespace, read_module, read_subroutine_type): Update. (sibling_die): Remove. --- gdb/ChangeLog | 12 +++++++++ gdb/dwarf2/read.c | 62 ++++++++++++++++++++--------------------------- 2 files changed, 38 insertions(+), 36 deletions(-) diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c index 87c4cae9b01..9d744ab0825 100644 --- a/gdb/dwarf2/read.c +++ b/gdb/dwarf2/read.c @@ -1416,8 +1416,6 @@ static const char *dwarf_bool_name (unsigned int); static const char *dwarf_type_encoding_name (unsigned int); -static struct die_info *sibling_die (struct die_info *); - static void dump_die_shallow (struct ui_file *, int indent, struct die_info *); static void dump_die_for_error (struct die_info *); @@ -10461,7 +10459,7 @@ read_import_statement (struct die_info *die, struct dwarf2_cu *cu) if (die->tag == DW_TAG_imported_module && cu->language == language_fortran) for (child_die = die->child; child_die && child_die->tag; - child_die = sibling_die (child_die)) + child_die = child_die->sibling) { /* DWARF-4: A Fortran use statement with a “rename list” may be represented by an imported module entry with an import attribute @@ -10739,7 +10737,7 @@ read_file_scope (struct die_info *die, struct dwarf2_cu *cu) while (child_die && child_die->tag) { process_die (child_die, cu); - child_die = sibling_die (child_die); + child_die = child_die->sibling; } } @@ -10907,7 +10905,7 @@ read_type_unit_scope (struct die_info *die, struct dwarf2_cu *cu) while (child_die && child_die->tag) { process_die (child_die, cu); - child_die = sibling_die (child_die); + child_die = child_die->sibling; } } } @@ -12680,7 +12678,7 @@ inherit_abstract_dies (struct die_info *die, struct dwarf2_cu *cu) for (child_die = die->child; child_die && child_die->tag; - child_die = sibling_die (child_die)) + child_die = child_die->sibling) { struct die_info *child_origin_die; struct dwarf2_cu *child_origin_cu; @@ -12757,7 +12755,7 @@ inherit_abstract_dies (struct die_info *die, struct dwarf2_cu *cu) if (!origin_child_die->in_process) process_die (origin_child_die, origin_cu); } - origin_child_die = sibling_die (origin_child_die); + origin_child_die = origin_child_die->sibling; } origin_cu->list_in_scope = origin_previous_list_in_scope; @@ -12826,7 +12824,7 @@ read_func_scope (struct die_info *die, struct dwarf2_cu *cu) /* If we have any template arguments, then we must allocate a different sort of symbol. */ - for (child_die = die->child; child_die; child_die = sibling_die (child_die)) + for (child_die = die->child; child_die; child_die = child_die->sibling) { if (child_die->tag == DW_TAG_template_type_param || child_die->tag == DW_TAG_template_value_param) @@ -12879,7 +12877,7 @@ read_func_scope (struct die_info *die, struct dwarf2_cu *cu) } else process_die (child_die, cu); - child_die = sibling_die (child_die); + child_die = child_die->sibling; } } @@ -12901,7 +12899,7 @@ read_func_scope (struct die_info *die, struct dwarf2_cu *cu) { if (child_die->tag == DW_TAG_imported_module) process_die (child_die, spec_cu); - child_die = sibling_die (child_die); + child_die = child_die->sibling; } /* In some cases, GCC generates specification DIEs that @@ -12990,7 +12988,7 @@ read_lexical_block_scope (struct die_info *die, struct dwarf2_cu *cu) GCC does no longer produces such DWARF since GCC r224161. */ for (child_die = die->child; child_die != NULL && child_die->tag; - child_die = sibling_die (child_die)) + child_die = child_die->sibling) process_die (child_die, cu); return; case PC_BOUNDS_INVALID: @@ -13006,7 +13004,7 @@ read_lexical_block_scope (struct die_info *die, struct dwarf2_cu *cu) while (child_die && child_die->tag) { process_die (child_die, cu); - child_die = sibling_die (child_die); + child_die = child_die->sibling; } } inherit_abstract_dies (die, cu); @@ -13087,7 +13085,7 @@ read_call_site_scope (struct die_info *die, struct dwarf2_cu *cu) nparams = 0; for (child_die = die->child; child_die && child_die->tag; - child_die = sibling_die (child_die)) + child_die = child_die->sibling) { if (child_die->tag != DW_TAG_call_site_parameter && child_die->tag != DW_TAG_GNU_call_site_parameter) @@ -13232,7 +13230,7 @@ read_call_site_scope (struct die_info *die, struct dwarf2_cu *cu) for (child_die = die->child; child_die && child_die->tag; - child_die = sibling_die (child_die)) + child_die = child_die->sibling) { struct call_site_parameter *parameter; struct attribute *loc, *origin; @@ -13859,7 +13857,7 @@ dwarf2_get_subprogram_pc_bounds (struct die_info *die, if (child->tag == DW_TAG_subprogram || child->tag == DW_TAG_lexical_block) dwarf2_get_subprogram_pc_bounds (child, lowpc, highpc, cu); - child = sibling_die (child); + child = child->sibling; } } @@ -13915,7 +13913,7 @@ get_scope_pc_bounds (struct die_info *die, break; } - child = sibling_die (child); + child = child->sibling; } } @@ -15153,7 +15151,7 @@ handle_struct_member_die (struct die_info *child_die, struct type *type, for (die_info *variant_child = child_die->child; variant_child != NULL; - variant_child = sibling_die (variant_child)) + variant_child = variant_child->sibling) { if (variant_child->tag == DW_TAG_member) { @@ -15243,7 +15241,7 @@ process_structure_scope (struct die_info *die, struct dwarf2_cu *cu) if (is_variant_part && discr_offset == child_die->sect_off) fi.fields.back ().variant.is_discriminant = true; - child_die = sibling_die (child_die); + child_die = child_die->sibling; } /* Attach template arguments to type. */ @@ -15391,7 +15389,7 @@ process_structure_scope (struct die_info *die, struct dwarf2_cu *cu) else process_die (child_die, cu); - child_die = sibling_die (child_die); + child_die = child_die->sibling; } /* Do not consider external references. According to the DWARF standard, @@ -15452,7 +15450,7 @@ update_enumeration_type_from_children (struct die_info *die, for (child_die = die->child; child_die != NULL && child_die->tag; - child_die = sibling_die (child_die)) + child_die = child_die->sibling) { struct attribute *attr; LONGEST value; @@ -15628,7 +15626,7 @@ process_enumeration_scope (struct die_info *die, struct dwarf2_cu *cu) } } - child_die = sibling_die (child_die); + child_die = child_die->sibling; } if (!fields.empty ()) @@ -15739,7 +15737,7 @@ read_array_type (struct die_info *die, struct dwarf2_cu *cu) range_types.push_back (child_type); } } - child_die = sibling_die (child_die); + child_die = child_die->sibling; } /* Dwarf2 dimensions are output from left to right, create the @@ -15976,7 +15974,7 @@ read_common_block (struct die_info *die, struct dwarf2_cu *cu) for (child_die = die->child; child_die && child_die->tag; - child_die = sibling_die (child_die)) + child_die = child_die->sibling) ++n_entries; size = (sizeof (struct common_block) @@ -15989,7 +15987,7 @@ read_common_block (struct die_info *die, struct dwarf2_cu *cu) for (child_die = die->child; child_die && child_die->tag; - child_die = sibling_die (child_die)) + child_die = child_die->sibling) { /* Create the symbol in the DW_TAG_common_block block in the current symbol scope. */ @@ -16111,7 +16109,7 @@ read_namespace (struct die_info *die, struct dwarf2_cu *cu) while (child_die && child_die->tag) { process_die (child_die, cu); - child_die = sibling_die (child_die); + child_die = child_die->sibling; } } } @@ -16147,7 +16145,7 @@ read_module (struct die_info *die, struct dwarf2_cu *cu) while (child_die && child_die->tag) { process_die (child_die, cu); - child_die = sibling_die (child_die); + child_die = child_die->sibling; } } @@ -16646,7 +16644,7 @@ read_subroutine_type (struct die_info *die, struct dwarf2_cu *cu) nparams++; else if (child_die->tag == DW_TAG_unspecified_parameters) TYPE_VARARGS (ftype) = 1; - child_die = sibling_die (child_die); + child_die = child_die->sibling; } /* Allocate storage for parameters and fill them in. */ @@ -16717,7 +16715,7 @@ read_subroutine_type (struct die_info *die, struct dwarf2_cu *cu) TYPE_FIELD_TYPE (ftype, iparams) = arg_type; iparams++; } - child_die = sibling_die (child_die); + child_die = child_die->sibling; } } @@ -21238,14 +21236,6 @@ typename_concat (struct obstack *obs, const char *prefix, const char *suffix, } } -/* Return sibling of die, NULL if no sibling. */ - -static struct die_info * -sibling_die (struct die_info *die) -{ - return die->sibling; -} - /* Get name of a die, return NULL if not found. */ static const char * -- 2.17.2