[binutils-gdb] Move symbol::value_block to symtab.c

Tom Tromey tromey@sourceware.org
Thu Nov 6 22:03:50 GMT 2025


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

commit 3f48c9f88c9523c7b098b1a2284f0b0139864b75
Author: Tom Tromey <tom@tromey.com>
Date:   Wed Oct 22 15:23:03 2025 -0600

    Move symbol::value_block to symtab.c
    
    It seems to me that symbol::value_block doesn't particularly need to
    be inlined.  This patch moves it to symtab.c.

Diff:
---
 gdb/symtab.c | 12 ++++++++++++
 gdb/symtab.h | 10 ----------
 2 files changed, 12 insertions(+), 10 deletions(-)

diff --git a/gdb/symtab.c b/gdb/symtab.c
index 3195cd2e2ae..7117e0d7fea 100644
--- a/gdb/symtab.c
+++ b/gdb/symtab.c
@@ -6586,6 +6586,18 @@ symbol::get_maybe_copied_address () const
 
 /* See symtab.h.  */
 
+const block *
+symbol::value_block () const
+{
+  if (const symbol_block_ops *block_ops = this->block_ops ();
+      block_ops != nullptr && block_ops->get_block_value != nullptr)
+    return block_ops->get_block_value (this);
+
+  return m_value.block;
+}
+
+/* See symtab.h.  */
+
 CORE_ADDR
 minimal_symbol::get_maybe_copied_address (objfile *objf) const
 {
diff --git a/gdb/symtab.h b/gdb/symtab.h
index 486b99d123a..9c7fe0fbf1a 100644
--- a/gdb/symtab.h
+++ b/gdb/symtab.h
@@ -1565,16 +1565,6 @@ struct block_symbol
 
 #define SYMBOL_LOCATION_BATON(symbol)   (symbol)->aux_value
 
-inline const block *
-symbol::value_block () const
-{
-  if (const symbol_block_ops *block_ops = this->block_ops ();
-      block_ops != nullptr && block_ops->get_block_value != nullptr)
-    return block_ops->get_block_value (this);
-
-  return m_value.block;
-}
-
 extern int register_symbol_computed_impl (location_class,
 					  const struct symbol_computed_ops *);


More information about the Gdb-cvs mailing list