diff options
author | Nathan Sidwell <nathan@acm.org> | 2022-06-09 08:14:31 -0700 |
---|---|---|
committer | Nathan Sidwell <nathan@acm.org> | 2022-06-10 12:32:22 -0700 |
commit | e6d369bbdb4eb5f03eec233ef9905013a735fd71 (patch) | |
tree | ae76fb667433af3f913283f40d041fe763026afe /gcc/cp/cp-tree.h | |
parent | 1eff4872d2e57c481f7218d25eecbfba647504e1 (diff) | |
download | gcc-e6d369bbdb4eb5f03eec233ef9905013a735fd71.zip gcc-e6d369bbdb4eb5f03eec233ef9905013a735fd71.tar.gz gcc-e6d369bbdb4eb5f03eec233ef9905013a735fd71.tar.bz2 |
c++: Add a late-writing step for modules
To add a module initializer optimization, we need to defer finishing writing
out the module file until the end of determining the dynamic initializers.
This is achieved by passing some saved-state from the main module writing
to a new function that completes it.
This patch merely adds the skeleton of that state and move things around,
allowing the finalization of the ELF file to be postponed. None of the
contents writing is moved, or the init optimization added.
gcc/cp/
* cp-tree.h (fini_modules): Add some parameters.
(finish_module_processing): Return an opaque pointer.
* decl2.cc (c_parse_final_cleanups): Propagate a cookie from
finish_module_processing to fini_modules.
* module.cc (struct module_processing_cookie): New.
(finish_module_processing): Return a heap-allocated cookie.
(late_finish_module): New. Finish out the module writing.
(fini_modules): Adjust.
Diffstat (limited to 'gcc/cp/cp-tree.h')
-rw-r--r-- | gcc/cp/cp-tree.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/gcc/cp/cp-tree.h b/gcc/cp/cp-tree.h index f1294da..60d7b20 100644 --- a/gcc/cp/cp-tree.h +++ b/gcc/cp/cp-tree.h @@ -7209,9 +7209,9 @@ extern void import_module (module_state *, location_t, bool export_p, extern void declare_module (module_state *, location_t, bool export_p, tree attr, cpp_reader *); extern void init_modules (cpp_reader *); -extern void fini_modules (); +extern void fini_modules (cpp_reader *, void *cookie); extern void maybe_check_all_macros (cpp_reader *); -extern void finish_module_processing (cpp_reader *); +extern void *finish_module_processing (cpp_reader *); extern char const *module_name (unsigned, bool header_ok); extern bitmap get_import_bitmap (); extern bitmap visible_instantiation_path (bitmap *); |