c++: Mangling for modules
authorNathan Sidwell <nathan@acm.org>
Tue, 8 Dec 2020 14:07:19 +0000 (06:07 -0800)
committerNathan Sidwell <nathan@acm.org>
Tue, 8 Dec 2020 14:11:27 +0000 (06:11 -0800)
commit210d143dbc575f293affbd55417505bcb8257d74
tree4ef923731b7db45f1fb166c568ce159bf9080f40
parentedbbf7363cff62fc7ff536b5fa64e39f5a4d6496
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.
gcc/cp/cp-tree.h
gcc/cp/mangle.c
gcc/cp/module.cc