73baba1ae1
This implements a new module mangling ABI as the original one has a few issues: a) it was not demangleable (oops) b) implemented a weak ownership model. This implements a strong ownership model, so that exported entities from named modules are mangled to include their module attachment. This gives more informative linker diagnostics and better module isolation. Weak ownership was hoped to allow backwards compatibility with non-modular code, but in practice was very brittle, and C++20 added new semantics for linkage declarations that cover the needed functionality. FAOD Clang is also moving to this ABI and documentation will be added to the Itanium ABI specification. gcc/cp/ * cp-tree.h (mangle_identifier): Replace with ... (mangle_module_component): ... this. * mangle.cc (dump_substitution_candidates): Adjust. (add_substitution): Likewise. (find_substitution): Likewise. (unmangled_name_p): Likewise. (mangle_module_substitution): Reimplement. (mangle_module_component): New. (write_module, maybe_write_module): Adjust. (write_name): Drop modules here. (write_unqualified): Do them here instead. (mangle_global_init): Adjust. * module.cc (module_state::mangle): Adjust. (mangle_module): Likewise. (get_originating_module): Adjust. gcc/testsuite/ * g++.dg/modules/fn-inline-1_b.C: Adjust. * g++.dg/modules/fn-inline-1_c.C: Adjust. * g++.dg/modules/imp-inline-1_a.C: Adjust. * g++.dg/modules/imp-inline-1_b.C: Adjust. * g++.dg/modules/init-2_a.C: Adjust. * g++.dg/modules/init-2_b.C: Adjust. * g++.dg/modules/init-2_c.C: Adjust. * g++.dg/modules/member-def-2_d.C: Adjust. * g++.dg/modules/mod-sym-1.C: Adjust. * g++.dg/modules/mod-sym-2.C: Adjust. * g++.dg/modules/mod-sym-3.C: Adjust. * g++.dg/modules/sym-subst-1.C: Adjust. * g++.dg/modules/sym-subst-2_b.C: Adjust. * g++.dg/modules/sym-subst-3_a.C: Adjust. * g++.dg/modules/sym-subst-3_b.C: Adjust. * g++.dg/modules/sym-subst-4.C: Adjust. * g++.dg/modules/sym-subst-5.C: Adjust. * g++.dg/modules/sym-subst-6.C: Adjust. * g++.dg/modules/tpl-spec-1_a.C: Adjust. * g++.dg/modules/tpl-spec-2_b.C: Adjust. * g++.dg/modules/tpl-spec-2_d.C: Adjust. * g++.dg/modules/tpl-spec-3_a.C: Adjust. * g++.dg/modules/virt-1_a.C: Adjust. * g++.dg/modules/virt-2_a.C: Adjust. * g++.dg/modules/virt-2_b.C: Adjust. * g++.dg/modules/virt-2_c.C: Adjust. * g++.dg/modules/vtt-1_a.C: Adjust. * g++.dg/modules/vtt-1_b.C: Adjust. |
||
---|---|---|
c++tools | ||
config | ||
contrib | ||
fixincludes | ||
gcc | ||
gnattools | ||
gotools | ||
include | ||
INSTALL | ||
intl | ||
libada | ||
libatomic | ||
libbacktrace | ||
libcc1 | ||
libcody | ||
libcpp | ||
libdecnumber | ||
libffi | ||
libgcc | ||
libgfortran | ||
libgo | ||
libgomp | ||
libiberty | ||
libitm | ||
libobjc | ||
liboffloadmic | ||
libphobos | ||
libquadmath | ||
libsanitizer | ||
libssp | ||
libstdc++-v3 | ||
libvtv | ||
lto-plugin | ||
maintainer-scripts | ||
zlib | ||
.dir-locals.el | ||
.gitattributes | ||
.gitignore | ||
ABOUT-NLS | ||
ar-lib | ||
ChangeLog | ||
ChangeLog.jit | ||
ChangeLog.tree-ssa | ||
compile | ||
config-ml.in | ||
config.guess | ||
config.rpath | ||
config.sub | ||
configure | ||
configure.ac | ||
COPYING | ||
COPYING3 | ||
COPYING3.LIB | ||
COPYING.LIB | ||
COPYING.RUNTIME | ||
depcomp | ||
install-sh | ||
libtool-ldflags | ||
libtool.m4 | ||
lt~obsolete.m4 | ||
ltgcc.m4 | ||
ltmain.sh | ||
ltoptions.m4 | ||
ltsugar.m4 | ||
ltversion.m4 | ||
MAINTAINERS | ||
Makefile.def | ||
Makefile.in | ||
Makefile.tpl | ||
missing | ||
mkdep | ||
mkinstalldirs | ||
move-if-change | ||
multilib.am | ||
README | ||
symlink-tree | ||
test-driver | ||
ylwrap |
This directory contains the GNU Compiler Collection (GCC). The GNU Compiler Collection is free software. See the files whose names start with COPYING for copying permission. The manuals, and some of the runtime libraries, are under different terms; see the individual source files for details. The directory INSTALL contains copies of the installation information as HTML and plain text. The source of this information is gcc/doc/install.texi. The installation information includes details of what is included in the GCC sources and what files GCC installs. See the file gcc/doc/gcc.texi (together with other files that it includes) for usage and porting information. An online readable version of the manual is in the files gcc/doc/gcc.info*. See http://gcc.gnu.org/bugs/ for how to report bugs usefully. Copyright years on GCC source files may be listed using range notation, e.g., 1987-2012, indicating that every year in the range, inclusive, is a copyrightable year that could otherwise be listed individually.