diff options
author | Tom Tromey <tom@tromey.com> | 2023-01-31 14:43:22 -0700 |
---|---|---|
committer | Tom Tromey <tom@tromey.com> | 2023-02-13 15:22:16 -0700 |
commit | cda0334434412d888443e9a98386255f2e0c2eab (patch) | |
tree | f8c03f634efa3dab4e58cb8888f47c073ea21ebe /gdb/valops.c | |
parent | e18312bb596fcc9b4df1d018038690df28a68b46 (diff) | |
download | binutils-gdb-cda0334434412d888443e9a98386255f2e0c2eab.tar.gz |
Turn value_copy into a method
This turns value_copy into a method of value. Much of this was
written by script.
Approved-By: Simon Marchi <simon.marchi@efficios.com>
Diffstat (limited to 'gdb/valops.c')
-rw-r--r-- | gdb/valops.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/gdb/valops.c b/gdb/valops.c index 2923d9fc0d1..aac32cc0917 100644 --- a/gdb/valops.c +++ b/gdb/valops.c @@ -325,7 +325,7 @@ value_cast_pointers (struct type *type, struct value *arg2, } /* No superclass found, just change the pointer type. */ - arg2 = value_copy (arg2); + arg2 = arg2->copy (); arg2->deprecated_set_type (type); arg2->set_enclosing_type (type); arg2->set_pointed_to_offset (0); /* pai: chk_val */ @@ -428,7 +428,7 @@ value_cast (struct type *type, struct value *arg2) value completely. */ if (arg2->type () != type) { - arg2 = value_copy (arg2); + arg2 = arg2->copy (); arg2->deprecated_set_type (type); } return arg2; @@ -647,7 +647,7 @@ value_cast (struct type *type, struct value *arg2) if (code1 == TYPE_CODE_PTR && code2 == TYPE_CODE_PTR) return value_cast_pointers (to_type, arg2, 0); - arg2 = value_copy (arg2); + arg2 = arg2->copy (); arg2->deprecated_set_type (to_type); arg2->set_enclosing_type (to_type); arg2->set_pointed_to_offset (0); /* pai: chk_val */ @@ -1342,7 +1342,7 @@ value_assign (struct value *toval, struct value *fromval) /* The return value is a copy of TOVAL so it shares its location information, but its contents are updated from FROMVAL. This implies the returned value is not lazy, even if TOVAL was. */ - val = value_copy (toval); + val = toval->copy (); val->set_lazy (0); copy (fromval->contents (), val->contents_raw ()); @@ -1572,7 +1572,7 @@ value_addr (struct value *arg1) struct type *enclosing_type_ptr = lookup_pointer_type (enclosing_type->target_type ()); - arg2 = value_copy (arg1); + arg2 = arg1->copy (); arg2->deprecated_set_type (type_ptr); arg2->set_enclosing_type (enclosing_type_ptr); @@ -2107,7 +2107,7 @@ struct_field_searcher::search (struct value *arg1, LONGEST offset, } else { - v2 = value_copy (arg1); + v2 = arg1->copy (); v2->deprecated_set_type (basetype); v2->set_embedded_offset (boffset); } @@ -3958,7 +3958,7 @@ value_full_object (struct value *argp, /* pai: FIXME -- sounds iffy */ if (full) { - argp = value_copy (argp); + argp = argp->copy (); argp->set_enclosing_type (real_type); return argp; } |