[31/47] Move value_ref_policy methods out-of-line

Message ID 20230209-submit-value-fixups-2023-v1-31-55dc2794dbb9@tromey.com
State Committed
Commit d3824ae14ac64c10733537969a0bd58a9385cbf2
Headers
Series Use methods for struct value |

Commit Message

Tom Tromey Feb. 9, 2023, 9:38 p.m. UTC
  This moves the value_ref_policy methods to be defined out-of-line.
This is a necessary step to change value_incref and value_decref to be
methods of value.
---
 gdb/value.h | 23 ++++++++++++++---------
 1 file changed, 14 insertions(+), 9 deletions(-)
  

Patch

diff --git a/gdb/value.h b/gdb/value.h
index bf5effccfa9..c72bee07ca6 100644
--- a/gdb/value.h
+++ b/gdb/value.h
@@ -124,15 +124,8 @@  extern void value_decref (struct value *val);
 
 struct value_ref_policy
 {
-  static void incref (struct value *ptr)
-  {
-    value_incref (ptr);
-  }
-
-  static void decref (struct value *ptr)
-  {
-    value_decref (ptr);
-  }
+  static void incref (struct value *ptr);
+  static void decref (struct value *ptr);
 };
 
 /* A gdb:;ref_ptr pointer to a struct value.  */
@@ -643,6 +636,18 @@  struct value
 			 int length) const;
 };
 
+inline void
+value_ref_policy::incref (struct value *ptr)
+{
+  value_incref (ptr);
+}
+
+inline void
+value_ref_policy::decref (struct value *ptr)
+{
+  value_decref (ptr);
+}
+
 /* Returns value_type or value_enclosing_type depending on
    value_print_options.objectprint.