c++: Tweak function cloning names
authorNathan Sidwell <nathan@acm.org>
Tue, 30 Jun 2020 17:43:08 +0000 (10:43 -0700)
committerNathan Sidwell <nathan@acm.org>
Tue, 30 Jun 2020 17:50:05 +0000 (10:50 -0700)
commitcc3ae9f5c4c0d449045b39250edab189d0e573d1
treeb073381c1d94b3973e8ab53886b4f4e11ad26a85
parentfe03543bfb8c88c3feb8076b5ff1690dc3903878
c++: Tweak function cloning names

On the modules branch I need to expose an intermediate step of the
function cloning, but before that it'd be nice to rationalize the
names somewhat, now that we also use that API for copying the equality
operator.  Jason's recent patch caused me some pain by altering the
same code.  I can only blame myself for not pushing some bits sooner.
Anyway, this patch makes the newly renamed copy_fndecl_with_name
static, and adds a wrapper copy_operator_fn, that takes an operator
code.  The cdtor cloning functions are renamed to explicitly note they
expect cdtors.  A followup patch will move some of the logic from
copy_fndecl_with_name to build_cdtor_clones.

gcc/cp/
* cp-tree.h (copy_fndecl_with_name): Rename to ...
(copy_operatorn_fn): ... this.  Change arg type.
(clone_function_decl): Rename to ...
(clone_cdtor): ... this.
* class.c (copy_fndecl_with_name): Make static.
(copy_operator_fn): New wrapper.
(build_clones): Rename to ...
(build_cdtor_clones): ... this.
(clone_function_decl): Rename to ...
(clone_cdtor): ... this.  Adjust build_clones calls.
(clone_constructors_and_destructors): Adjust clone_function_decl
calls.
* method.c (implicitly_declare_fn): Adjust copy_fndecl_with_name
call.
(lazily_declare_fn): Adjust clone_function_decl call.
* pt.c (tsubst_function_decl): Likewise.
(instantiate_template_1): Likewise.

libcc1/
* libcp1plugin.cc (plugin_build_decl): Adjust clone_function_decl
call.
gcc/cp/class.c
gcc/cp/cp-tree.h
gcc/cp/method.c
gcc/cp/pt.c
libcc1/libcp1plugin.cc