diff --git a/gdb/eval.c b/gdb/eval.c
index dca98d07fbe..808cc916bb4 100644
--- a/gdb/eval.c
+++ b/gdb/eval.c
@@ -111,7 +111,7 @@ expression::evaluate (struct type *expect_type, enum noside noside)
 
   if (stack_temporaries.has_value ()
       && value_in_thread_stack_temporaries (retval, inferior_thread ()))
-    retval = value_non_lval (retval);
+    retval = retval->non_lval ();
 
   return retval;
 }
@@ -1820,7 +1820,7 @@ eval_op_postinc (struct type *expect_type, struct expression *exp,
     }
   else
     {
-      struct value *arg3 = value_non_lval (arg1);
+      struct value *arg3 = arg1->non_lval ();
       struct value *arg2;
 
       if (ptrmath_type_p (exp->language_defn, arg1->type ()))
@@ -1854,7 +1854,7 @@ eval_op_postdec (struct type *expect_type, struct expression *exp,
     }
   else
     {
-      struct value *arg3 = value_non_lval (arg1);
+      struct value *arg3 = arg1->non_lval ();
       struct value *arg2;
 
       if (ptrmath_type_p (exp->language_defn, arg1->type ()))
diff --git a/gdb/infcall.c b/gdb/infcall.c
index d6992228498..81a073d2123 100644
--- a/gdb/infcall.c
+++ b/gdb/infcall.c
@@ -492,7 +492,7 @@ get_call_return_value (struct call_return_meta_info *ri)
 	     requiring GDB to evaluate the "this" pointer.  To evaluate
 	     the this pointer, GDB needs the memory address of the
 	     value.  */
-	  value_force_lval (retval, ri->struct_addr);
+	  retval->force_lval (ri->struct_addr);
 	  push_thread_stack_temporary (thr, retval);
 	}
     }
diff --git a/gdb/value.c b/gdb/value.c
index a9db9e04bab..9cef9f4fcea 100644
--- a/gdb/value.c
+++ b/gdb/value.c
@@ -1432,35 +1432,35 @@ make_cv_value (int cnst, int voltl, struct value *v)
   return cv_val;
 }
 
-/* Return a version of ARG that is non-lvalue.  */
+/* See value.h.  */
 
 struct value *
-value_non_lval (struct value *arg)
+value::non_lval ()
 {
-  if (VALUE_LVAL (arg) != not_lval)
+  if (VALUE_LVAL (this) != not_lval)
     {
-      struct type *enc_type = arg->enclosing_type ();
+      struct type *enc_type = enclosing_type ();
       struct value *val = value::allocate (enc_type);
 
-      gdb::copy (arg->contents_all (), val->contents_all_raw ());
-      val->m_type = arg->m_type;
-      val->set_embedded_offset (arg->embedded_offset ());
-      val->set_pointed_to_offset (arg->pointed_to_offset ());
+      gdb::copy (contents_all (), val->contents_all_raw ());
+      val->m_type = m_type;
+      val->set_embedded_offset (embedded_offset ());
+      val->set_pointed_to_offset (pointed_to_offset ());
       return val;
     }
-   return arg;
+  return this;
 }
 
-/* Write contents of V at ADDR and set its lval type to be LVAL_MEMORY.  */
+/* See value.h.  */
 
 void
-value_force_lval (struct value *v, CORE_ADDR addr)
+value::force_lval (CORE_ADDR addr)
 {
-  gdb_assert (VALUE_LVAL (v) == not_lval);
+  gdb_assert (VALUE_LVAL (this) == not_lval);
 
-  write_memory (addr, v->contents_raw ().data (), v->type ()->length ());
-  v->m_lval = lval_memory;
-  v->m_location.address = addr;
+  write_memory (addr, contents_raw ().data (), type ()->length ());
+  m_lval = lval_memory;
+  m_location.address = addr;
 }
 
 void
diff --git a/gdb/value.h b/gdb/value.h
index f46d0fc9d78..ba45ad64ff0 100644
--- a/gdb/value.h
+++ b/gdb/value.h
@@ -533,6 +533,13 @@ struct value
      for LENGTH bits as optimized out.  */
   void mark_bits_optimized_out (LONGEST offset, LONGEST length);
 
+  /* Return a version of this that is non-lvalue.  */
+  struct value *non_lval ();
+
+  /* Write contents of this value at ADDR and set its lval type to be
+     LVAL_MEMORY.  */
+  void force_lval (CORE_ADDR);
+
 
   /* Type of value; either not an lval, or one of the various
      different possible kinds of lval.  */
@@ -1412,10 +1419,6 @@ extern void preserve_values (struct objfile *);
 
 /* From values.c */
 
-extern struct value *value_non_lval (struct value *);
-
-extern void value_force_lval (struct value *, CORE_ADDR);
-
 extern struct value *make_cv_value (int, int, struct value *);
 
 extern void preserve_one_value (struct value *, struct objfile *, htab_t);
