c++: Inform of CMI reads [PR 99166]
authorNathan Sidwell <nathan@acm.org>
Fri, 19 Feb 2021 17:18:13 +0000 (09:18 -0800)
committerNathan Sidwell <nathan@acm.org>
Fri, 19 Feb 2021 17:40:12 +0000 (09:40 -0800)
commitbfe83ae38e871a2e4205ce63fd9d3247dff412bd
tree8e723cf7a4017d46a7aa27d45cbb77972e7188e8
parentf86e187e12db14ad1cced26b9f8aafb06498e208
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.
gcc/c-family/c.opt
gcc/cp/module.cc
gcc/doc/invoke.texi
gcc/testsuite/g++.dg/modules/pr99166_a.X [new file with mode: 0644]
gcc/testsuite/g++.dg/modules/pr99166_b.C [new file with mode: 0644]
gcc/testsuite/g++.dg/modules/pr99166_c.C [new file with mode: 0644]
gcc/testsuite/g++.dg/modules/pr99166_d.C [new file with mode: 0644]