c++: Mangling for modules
This is the mangling changes for modules. These were developed in
collaboration with clang, which also implemements the same ABI (or
plans to, I do not think the global init is in clang). The global
init mangling is captured in
https://github.com/itanium-cxx-abi/cxx-abi/issues/99
gcc/cp/
* cp-tree.h (mangle_module_substitution, mangle_identifier)
(mangle_module_global_init): Declare.
* mangle.c (struct globals): Add mod field.
(mangle_module_substitution, mangle_identifier)
(mangle_module_global_init): Define.
(write_module, maybe_write_module): New.
(write_name): Call it.
(start_mangling): Clear mod field.
(finish_mangling_internal): Adjust.
* module.cc (mangle_module, mangle_module_fini)
(get_originating_module): Stubs.