c++: Expose cloning form predicates
authorNathan Sidwell <nathan@acm.org>
Wed, 1 Jul 2020 15:56:32 +0000 (08:56 -0700)
committerNathan Sidwell <nathan@acm.org>
Wed, 1 Jul 2020 16:00:34 +0000 (09:00 -0700)
commit27aebb7d6cf14175aac862ab29f83a93538bfad8
tree369ba3a93d5c489442e58abb9a57a1a6b583c747
parent0d7e5fa655e59c99035bf94a46c912e369bb9fa0
c++: Expose cloning form predicates

A further adjustment of the function cloning.  Rather than have
copy_fndecl_with_name deduce whether a particular cdtor needs a
vtt_parm and/or has inherited parms to drop, pass that information in
from the caller.  In particular build_cdtor_clones knows when its
building the particular cdtors that might need these.  On the modules
branch I need to clone cdtors before the underlying class information
is necessarily complete.  There build_cdtor_clones is externally
callable to facilitate that.

gcc/cp/
* class.c (copy_fndecl_with_name): Add additional predicate args, do
not deduce them locally.
(copy_operator_fn): Adjust copy_fndecl_with_name call.
(build_clone): Add vtt and inherited predicate args.  Pass through
to copy_fndecl_with_name call.
(build_cdtor_clones): Likewise, pass through to build_clone as
needed.
(build_cdtor): Determine vtt and inherited here.
* cp-tree.h (DECL_NEEDS_CTT_PARM_P): Delete.
gcc/cp/class.c
gcc/cp/cp-tree.h