Turn various value copying-related functions into methods

This patch turns a grab bag of value functions to methods of value.
These are done together because their implementations are
interrelated.

Approved-By: Simon Marchi <simon.marchi@efficios.com>
This commit is contained in:
Tom Tromey
2023-02-01 07:27:50 -07:00
parent e3fb3c4772
commit 6c49729e59
16 changed files with 193 additions and 197 deletions

View File

@@ -159,7 +159,7 @@ fortran_bounds_all_dims (bool lbound_p,
gdb_assert (dst_offset + v->type ()->length ()
<= result->type ()->length ());
gdb_assert (v->type ()->length () == elm_len);
value_contents_copy (result, dst_offset, v, 0, elm_len);
v->contents_copy (result, dst_offset, 0, elm_len);
/* Peel another dimension of the array. */
array_type = array_type->target_type ();
@@ -282,8 +282,8 @@ protected:
available offset. */
void copy_element_to_dest (struct value *elt)
{
value_contents_copy (m_dest, m_dest_offset, elt, 0,
elt->type ()->length ());
elt->contents_copy (m_dest, m_dest_offset, 0,
elt->type ()->length ());
m_dest_offset += elt->type ()->length ();
}
@@ -744,7 +744,7 @@ fortran_array_shape (struct gdbarch *gdbarch, const language_defn *lang,
gdb_assert (dst_offset + v->type ()->length ()
<= result->type ()->length ());
gdb_assert (v->type ()->length () == elm_len);
value_contents_copy (result, dst_offset, v, 0, elm_len);
v->contents_copy (result, dst_offset, 0, elm_len);
/* Peel another dimension of the array. */
val_type = val_type->target_type ();