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

@@ -330,7 +330,7 @@ cp_print_value_fields (struct value *val, struct ui_file *stream,
}
else
{
struct value *v = value_primitive_field (val, 0, i, type);
struct value *v = val->primitive_field (0, i, type);
opts->deref_ref = false;
common_val_print (v, stream, recurse + 1, opts,
current_language);
@@ -498,8 +498,8 @@ cp_print_value (struct value *val, struct ui_file *stream,
if (!val_print_check_max_depth (stream, recurse, options,
current_language))
{
struct value *baseclass_val = value_primitive_field (val, 0,
i, type);
struct value *baseclass_val = val->primitive_field (0,
i, type);
/* Attempt to run an extension language pretty-printer on the
baseclass if possible. */