c++: Extend build_array_type API
authorNathan Sidwell <nathan@acm.org>
Wed, 2 Dec 2020 15:35:23 +0000 (07:35 -0800)
committerNathan Sidwell <nathan@acm.org>
Wed, 2 Dec 2020 15:35:23 +0000 (07:35 -0800)
commit329ae1d7751346ba166d34e77a43e8cc33daa1c9
treeef42194e4e5c62b7eb3f3a735bb4eb7561bac96c
parent744ca1bf1cc07627f85c2f73a2ced3fb551e1f60
c++: Extend build_array_type API

The modules machinery needs to construct array types, and that wanted
to determine type dependency.  That doesn't work during loading, but
the module loader can stream that fact too and tell the array builder.
Thus this extends the API to allow a caller to specify the dependency
explicitly.  The call in cp_build_qualified_type_real is unreachable
during the loading, so that one's ok as is.

gcc/cp/
* cp-tree.h (build_cplus_array_type): Add defaulted DEP parm.
* tree.c (set_array_type_common): Add DEP parm.
(build_cplus_array_type): Add DEP parm, determine dependency if
needed.
(cp_build_qualified_type_real): Adjust array-building call.
(strip_typedefs): Likewise.
gcc/cp/cp-tree.h
gcc/cp/tree.c