public inbox for gdb-cvs@sourceware.org
help / color / mirror / Atom feed
From: Simon Marchi <simark@sourceware.org>
To: gdb-cvs@sourceware.org
Subject: [binutils-gdb] gdb: remove SYMBOL_IMPL macro, add method
Date: Sun,  6 Feb 2022 21:10:38 +0000 (GMT)	[thread overview]
Message-ID: <20220206211038.F2E613858424@sourceware.org> (raw)

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=d1eebf9a6f02786eb0d5f6b961b8d692d23e77b1

commit d1eebf9a6f02786eb0d5f6b961b8d692d23e77b1
Author: Simon Marchi <simon.marchi@efficios.com>
Date:   Sun Nov 21 22:10:47 2021 -0500

    gdb: remove SYMBOL_IMPL macro, add method
    
    Add a getter for a symbol's "impl".  Remove the corresponding macro and
    adjust all callers.
    
    Change-Id: Ibe26ed442f0f99a0f5cddafca30bd96ec7fb9fa8

Diff:
---
 gdb/symtab.h | 18 +++++++++++-------
 1 file changed, 11 insertions(+), 7 deletions(-)

diff --git a/gdb/symtab.h b/gdb/symtab.h
index aa380aa7be2..3a22d3e19ee 100644
--- a/gdb/symtab.h
+++ b/gdb/symtab.h
@@ -1105,6 +1105,8 @@ enum symbol_subclass_kind
   SYMBOL_RUST_VTABLE
 };
 
+extern const struct symbol_impl *symbol_impls;
+
 /* This structure is space critical.  See space comments at the top.  */
 
 struct symbol : public general_symbol_info, public allocate_on_obstack
@@ -1146,6 +1148,11 @@ struct symbol : public general_symbol_info, public allocate_on_obstack
     m_aclass_index = aclass_index;
   }
 
+  const symbol_impl &impl () const
+  {
+    return symbol_impls[this->aclass_index ()];
+  }
+
   /* Data type of value */
 
   struct type *type = nullptr;
@@ -1245,14 +1252,11 @@ struct block_symbol
   const struct block *block;
 };
 
-extern const struct symbol_impl *symbol_impls;
-
 /* Note: There is no accessor macro for symbol.owner because it is
    "private".  */
 
 #define SYMBOL_DOMAIN(symbol)	(symbol)->domain
-#define SYMBOL_IMPL(symbol)		(symbol_impls[(symbol)->aclass_index ()])
-#define SYMBOL_CLASS(symbol)		(SYMBOL_IMPL (symbol).aclass)
+#define SYMBOL_CLASS(symbol)		((symbol)->impl ().aclass)
 #define SYMBOL_OBJFILE_OWNED(symbol)	((symbol)->is_objfile_owned)
 #define SYMBOL_IS_ARGUMENT(symbol)	(symbol)->is_argument
 #define SYMBOL_INLINED(symbol)		(symbol)->is_inlined
@@ -1260,9 +1264,9 @@ extern const struct symbol_impl *symbol_impls;
   (((symbol)->subclass) == SYMBOL_TEMPLATE)
 #define SYMBOL_TYPE(symbol)		(symbol)->type
 #define SYMBOL_LINE(symbol)		(symbol)->line
-#define SYMBOL_COMPUTED_OPS(symbol)	(SYMBOL_IMPL (symbol).ops_computed)
-#define SYMBOL_BLOCK_OPS(symbol)	(SYMBOL_IMPL (symbol).ops_block)
-#define SYMBOL_REGISTER_OPS(symbol)	(SYMBOL_IMPL (symbol).ops_register)
+#define SYMBOL_COMPUTED_OPS(symbol)	((symbol)->impl ().ops_computed)
+#define SYMBOL_BLOCK_OPS(symbol)	((symbol)->impl ().ops_block)
+#define SYMBOL_REGISTER_OPS(symbol)	((symbol)->impl ().ops_register)
 #define SYMBOL_LOCATION_BATON(symbol)   (symbol)->aux_value
 
 extern int register_symbol_computed_impl (enum address_class,


                 reply	other threads:[~2022-02-06 21:10 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220206211038.F2E613858424@sourceware.org \
    --to=simark@sourceware.org \
    --cc=gdb-cvs@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).