From patchwork Thu Jun 27 15:06:19 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Tromey X-Patchwork-Id: 33453 Received: (qmail 9268 invoked by alias); 27 Jun 2019 15:06:28 -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 9255 invoked by uid 89); 27 Jun 2019 15:06:28 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-23.1 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_STOCKGEN, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.1 spammy=HContent-Transfer-Encoding:8bit X-HELO: rock.gnat.com Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 27 Jun 2019 15:06:27 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id 9C743560A4; Thu, 27 Jun 2019 11:06:25 -0400 (EDT) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id dnzWQ9WJdCVo; Thu, 27 Jun 2019 11:06:25 -0400 (EDT) Received: from murgatroyd.Home (75-166-12-78.hlrn.qwest.net [75.166.12.78]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by rock.gnat.com (Postfix) with ESMTPSA id 3663F560A2; Thu, 27 Jun 2019 11:06:25 -0400 (EDT) From: Tom Tromey To: gdb-patches@sourceware.org Cc: Joel Brobecker , Tom Tromey Subject: [PATCH] Remove is_a_field_of_this from ada_lookup_symbol Date: Thu, 27 Jun 2019 09:06:19 -0600 Message-Id: <20190627150619.2505-1-tromey@adacore.com> MIME-Version: 1.0 All callers of ada_lookup_symbol pass NULL for the "is_a_field_of_this" parameter, so remove it. gdb/ChangeLog 2019-06-27 Tom Tromey * ada-exp.y (find_primitive_type): Update. * ada-lang.h (ada_lookup_symbol): Update. * ada-lang.c (ada_lookup_symbol): Remove "is_a_field_of_this" parameter. (ada_lookup_encoded_symbol, ada_lookup_symbol_nonlocal): Update. --- gdb/ChangeLog | 8 ++++++++ gdb/ada-exp.y | 2 +- gdb/ada-lang.c | 12 ++++-------- gdb/ada-lang.h | 2 +- 4 files changed, 14 insertions(+), 10 deletions(-) diff --git a/gdb/ada-exp.y b/gdb/ada-exp.y index f7ce27aca35..2c8f3d6572e 100644 --- a/gdb/ada-exp.y +++ b/gdb/ada-exp.y @@ -1041,7 +1041,7 @@ find_primitive_type (struct parser_state *par_state, char *name) (char *) alloca (strlen (name) + sizeof ("standard__")); strcpy (expanded_name, "standard__"); strcat (expanded_name, name); - sym = ada_lookup_symbol (expanded_name, NULL, VAR_DOMAIN, NULL).symbol; + sym = ada_lookup_symbol (expanded_name, NULL, VAR_DOMAIN).symbol; if (sym != NULL && SYMBOL_CLASS (sym) == LOC_TYPEDEF) type = SYMBOL_TYPE (sym); } diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c index 1e996557b6e..332363b1ecc 100644 --- a/gdb/ada-lang.c +++ b/gdb/ada-lang.c @@ -5778,22 +5778,18 @@ ada_lookup_encoded_symbol (const char *name, const struct block *block, std::string verbatim = std::string ("<") + name + '>'; gdb_assert (info != NULL); - *info = ada_lookup_symbol (verbatim.c_str (), block, domain, NULL); + *info = ada_lookup_symbol (verbatim.c_str (), block, domain); } /* Return a symbol in DOMAIN matching NAME, in BLOCK0 and enclosing scope and in global scopes, or NULL if none. NAME is folded and encoded first. Otherwise, the result is as for ada_lookup_symbol_list, - choosing the first symbol if there are multiple choices. - If IS_A_FIELD_OF_THIS is not NULL, it is set to zero. */ + choosing the first symbol if there are multiple choices. */ struct block_symbol ada_lookup_symbol (const char *name, const struct block *block0, - domain_enum domain, int *is_a_field_of_this) + domain_enum domain) { - if (is_a_field_of_this != NULL) - *is_a_field_of_this = 0; - std::vector candidates; int n_candidates; @@ -5815,7 +5811,7 @@ ada_lookup_symbol_nonlocal (const struct language_defn *langdef, { struct block_symbol sym; - sym = ada_lookup_symbol (name, block_static_block (block), domain, NULL); + sym = ada_lookup_symbol (name, block_static_block (block), domain); if (sym.symbol != NULL) return sym; diff --git a/gdb/ada-lang.h b/gdb/ada-lang.h index ff6c3399eaf..b10c680ac1c 100644 --- a/gdb/ada-lang.h +++ b/gdb/ada-lang.h @@ -239,7 +239,7 @@ extern char *ada_fold_name (const char *); extern struct block_symbol ada_lookup_symbol (const char *, const struct block *, - domain_enum, int *); + domain_enum); extern void ada_lookup_encoded_symbol (const char *name, const struct block *block, domain_enum domain,