c++: Inform of CMI reads [PR 99166]
When successfully reading a module CMI, the user gets no indication of
where that CMI was located. I originally didn't consider this a
problem -- the read was successful after all. But it can make it
difficult to interact with build systems, particularly when caching
can be involved. Grovelling over internal dump files is not really
useful to the user. Hence this option, which is similar to the
-flang-info-include-translate variants, and allows the user to ask for
all, or specific module read notification.
gcc/c-family/
* c.opt (flang-info-module-read, flang-info-module-read=): New.
gcc/
* doc/invoke.texi (flang-info-module-read): Document.
gcc/cp/
* module.cc (note_cmis): New.
(struct module_state): Add inform_read_p bit.
(module_state::do_import): Inform of CMI location, if enabled.
(init_modules): Canonicalize note_cmis entries.
(handle_module_option): Handle -flang-info-module-read=FOO.
gcc/testsuite/
* g++.dg/modules/pr99166_a.X: New.
* g++.dg/modules/pr99166_b.C: New.
* g++.dg/modules/pr99166_c.C: New.
* g++.dg/modules/pr99166_d.C: New.