diff options
author | Simon Marchi <simon.marchi@polymtl.ca> | 2018-01-07 09:25:33 -0500 |
---|---|---|
committer | Simon Marchi <simon.marchi@ericsson.com> | 2018-01-07 09:25:33 -0500 |
commit | f979c73fd0be9a8a683f79af40c7b939c2a65d9f (patch) | |
tree | bd3778595c1cf1ad5659e43435e329027f095a84 /gdb/valops.c | |
parent | ba18742c3a1b62ff218db99bee47bb932af6dab9 (diff) | |
download | binutils-gdb-f979c73fd0be9a8a683f79af40c7b939c2a65d9f.tar.gz |
Remove xmethod_worker::clone
I think that the clone method of xmethod_worker can be removed. It is
only used in find_overload_match, to clone an xmethod we want to
keep. Instead, we can just std::move it out of the vector and into
value_from_xmethod. value_from_xmethod creates a value that will own
the xmethod_worker from that point. Other xmethod_workers left in the
vector will get destroyed when the vector gets destroyed, but the chosen
one will keep living inside the value struct.
gdb/ChangeLog:
* extension.h (struct xmethod_worker) <clone>: Remove.
* python/py-xmethods.c (struct python_xmethod_worker) <clone>:
Remove.
(python_xmethod_worker::clone): Remove.
* valops.c (find_overload_match): Use std::move instead of
clone.
Diffstat (limited to 'gdb/valops.c')
-rw-r--r-- | gdb/valops.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/gdb/valops.c b/gdb/valops.c index 8fccfe93019..e038c04fd1d 100644 --- a/gdb/valops.c +++ b/gdb/valops.c @@ -2778,7 +2778,7 @@ find_overload_match (struct value **args, int nargs, } else *valp = value_from_xmethod - (xm_worker_vec[ext_method_oload_champ]->clone ()); + (std::move (xm_worker_vec[ext_method_oload_champ])); } else *symp = oload_syms[func_oload_champ]; |