c++: Refactor clone copying
authorNathan Sidwell <nathan@acm.org>
Tue, 3 Nov 2020 18:15:54 +0000 (10:15 -0800)
committerNathan Sidwell <nathan@acm.org>
Tue, 3 Nov 2020 18:23:44 +0000 (10:23 -0800)
commit78f2f08ac8f22a0ad412a2abf5225b5fe3176bcf
tree687582b6c3faedb709af4dcbacba3e1b417f1c26
parentf4a0e873be8a6c2787c13bd29c0b2a5df332adeb
c++: Refactor clone copying

This patch sets copy_fndecl_with_name to always inform
rest_of_decl_compilation that it is not a top-level decl (it's a
member function).  I also refactor build_cdtor_clones to conditionally
do the method vector updating.  That happens to be a better interface
for modules to use.

gcc/cp/
* class.c (copy_fndecl_with_name):  Always not top level.
(build_cdtor_clones): Add update_methods parm, use it to
conditionally update the method vec.  Return void
(clone_cdtor): Adjust.
(clone_constructors_and_destructors): Adjust comment.
gcc/cp/class.c