[02/47] Move ~value body out-of-line

Message ID 20230209-submit-value-fixups-2023-v1-2-55dc2794dbb9@tromey.com
State New
Headers
Series Use methods for struct value |

Commit Message

Tom Tromey Feb. 9, 2023, 9:38 p.m. UTC
  struct value is going to move to value.h, but to avoid having
excessive code there, first move the destructor body out-of-line.
---
 gdb/value.c | 26 ++++++++++++++------------
 1 file changed, 14 insertions(+), 12 deletions(-)
  

Patch

diff --git a/gdb/value.c b/gdb/value.c
index c998a516a0f..b5e5a46573d 100644
--- a/gdb/value.c
+++ b/gdb/value.c
@@ -190,18 +190,7 @@  struct value
   {
   }
 
-  ~value ()
-  {
-    if (VALUE_LVAL (this) == lval_computed)
-      {
-	const struct lval_funcs *funcs = m_location.computed.funcs;
-
-	if (funcs->free_closure)
-	  funcs->free_closure (this);
-      }
-    else if (VALUE_LVAL (this) == lval_xcallable)
-      delete m_location.xm_worker;
-  }
+  ~value ();
 
   DISABLE_COPY_AND_ASSIGN (value);
 
@@ -371,6 +360,19 @@  struct value
   std::vector<range> m_optimized_out;
 };
 
+value::~value ()
+{
+  if (VALUE_LVAL (this) == lval_computed)
+    {
+      const struct lval_funcs *funcs = m_location.computed.funcs;
+
+      if (funcs->free_closure)
+	funcs->free_closure (this);
+    }
+  else if (VALUE_LVAL (this) == lval_xcallable)
+    delete m_location.xm_worker;
+}
+
 /* See value.h.  */
 
 struct gdbarch *