public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] Remove is_a_field_of_this from ada_lookup_symbol
@ 2019-06-27 15:06 Tom Tromey
  2019-06-29 14:37 ` Joel Brobecker
  0 siblings, 1 reply; 2+ messages in thread
From: Tom Tromey @ 2019-06-27 15:06 UTC (permalink / raw)
  To: gdb-patches; +Cc: Joel Brobecker, Tom Tromey

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  <tromey@adacore.com>

	* 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<struct block_symbol> 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,
-- 
2.20.1

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] Remove is_a_field_of_this from ada_lookup_symbol
  2019-06-27 15:06 [PATCH] Remove is_a_field_of_this from ada_lookup_symbol Tom Tromey
@ 2019-06-29 14:37 ` Joel Brobecker
  0 siblings, 0 replies; 2+ messages in thread
From: Joel Brobecker @ 2019-06-29 14:37 UTC (permalink / raw)
  To: Tom Tromey; +Cc: gdb-patches

Hi Tom,

On Thu, Jun 27, 2019 at 09:06:19AM -0600, Tom Tromey wrote:
> 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  <tromey@adacore.com>
> 
> 	* 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.

Thanks for doing this. This is OK.

-- 
Joel

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-06-29 14:37 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-27 15:06 [PATCH] Remove is_a_field_of_this from ada_lookup_symbol Tom Tromey
2019-06-29 14:37 ` Joel Brobecker

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).