mirror of
https://gcc.gnu.org/git/gcc.git
synced 2024-11-24 19:33:59 +08:00
90a6c3b6d6
Currently we generate static init/fini code by generating a set of functions taking an 'initp' bool and an unsigned priority. (There can be more than one, as we repeat the end-of-compile loop.) We then generate a set of real init or fini functions for each needed prioroty, calling the previous set of functions. This is of course very tangled, but excitingly the value-range-propagator is clever enough to unentangle it. However, the current arrangement makes generation awkward, particularly as to how to optimize the module-global-init generation. This reimplements the generation to generate a set of separate init/fini functions for each needed priority, and then call them from the real inits previously mentioned. This replaces a splay tree, recording which priority/init combos we needed, with a pair of hash tables, mapping priority to init functions. Much simpler. While there, rename several of the functions as they are only dealing with part of the init/fini generation, not the whole set. gcc/cp/ * decl2.cc (struct priority_info_s, priority_info): Delete. (priority_map_traits, priority_map_t): New. (static_init_fini_fns): New. (INITIALIZE_P_IDENTIFIER, PRIORITY_IDENTIFIER): Delete. (initialize_p_decl, priority_decl): Delete. (ssdf_decls, priority_info_map): Delete. (start_static_storage_duration_function): Rename to ... (start_partial_init_fini_fn): ... here. Create a void arg fn. Add it to the slot in the appropriate static_init_fini_fns hash table. (finish_static_storage_duration_function): Rename to ... (finish_partial_init_fini_fn): ... here. (get_priority_info): Delete. (one_static_initialization_or_destruction): Assert not trivial dtor. (do_static_initialization_or_destruction): Rename to ... (emit_partial_init_fini_fn) ... here. Start & finish the fn. Simply init/fini each var. (partition_vars_for_init_fini): Partition vars according to priority and add to init and/or fini list. (generate_ctor_or_dtor_function): Start and finish the function. Do santitizer calls here. (generate_ctor_and_dtor_functions_for_priority): Delete. (c_parse_final_cleanups): Reimplement global init/fini processing. gcc/testsuite/ * g++.dg/init/static-cdtor1.C: New. |
||
---|---|---|
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.