diff options
author | Nathan Sidwell <nathan@acm.org> | 2022-06-10 05:22:21 -0700 |
---|---|---|
committer | Nathan Sidwell <nathan@acm.org> | 2022-06-10 09:27:40 -0700 |
commit | c08ba00487c44c4e363f23bb1652f1d0cb6831c2 (patch) | |
tree | bc98d94e3d94c3eab70e1713a407590528346f22 /gcc/cp/cp-tree.h | |
parent | 1459b55d24ce6508330690bf4c932f7a5218c9f3 (diff) | |
download | gcc-c08ba00487c44c4e363f23bb1652f1d0cb6831c2.zip gcc-c08ba00487c44c4e363f23bb1652f1d0cb6831c2.tar.gz gcc-c08ba00487c44c4e363f23bb1652f1d0cb6831c2.tar.bz2 |
c++: Adjust module initializer calling emission
We special-case emitting the calls of module initializer functions. It's
simpler to just emit a static fn do do that, and add it onto the front of
the global init fn chain. We can also move the calculation of the set of
initializers to call to the point of use.
gcc/cp/
* cp-tree.h (module_has_import_init): Rename to ...
(module_determined_import_inits): ... here.
* decl2.cc (start_objects): Do not handle module initializers
here.
(c_parse_final_cleanups): Generate a separate module
initializer calling function and add it to the list. Shrink
the c-lang region.
* module.cc (num_init_calls_needed): Delete.
(module_has_import_init): Rename to ...
(module_determined_import_inits): ... here. Do the
calculation here ...
(finish_module_processing): ... rather than here.
(module_add_import_initializers): Reformat.
gcc/testsuite/
* g++.dg/modules/init-3_a.C: New.
* g++.dg/modules/init-3_b.C: New.
* g++.dg/modules/init-3_c.C: New.
Diffstat (limited to 'gcc/cp/cp-tree.h')
-rw-r--r-- | gcc/cp/cp-tree.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/gcc/cp/cp-tree.h b/gcc/cp/cp-tree.h index a5d9328..f1294da 100644 --- a/gcc/cp/cp-tree.h +++ b/gcc/cp/cp-tree.h @@ -7180,7 +7180,7 @@ extern module_state *get_module (tree name, module_state *parent = NULL, extern bool module_may_redeclare (tree decl); extern bool module_global_init_needed (); -extern bool module_has_import_inits (); +extern bool module_determine_import_inits (); extern void module_add_import_initializers (); /* Where the namespace-scope decl was originally declared. */ |