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.