]> git.ipfire.org Git - thirdparty/gcc.git/commit
c++/modules: Remember that header units have CMIs
authorNathaniel Shead <nathanieloshead@gmail.com>
Thu, 23 May 2024 12:56:52 +0000 (22:56 +1000)
committerNathaniel Shead <nathanieloshead@gmail.com>
Fri, 24 May 2024 14:10:41 +0000 (00:10 +1000)
commit03531ec45f15aa187bbab7842a1eb6cf746a104b
tree8297a49906273e8712721668dafb2dcfbecd0bec
parent0173dcce92baa62a74929814a75edb75eeab1a54
c++/modules: Remember that header units have CMIs

This appears to be an oversight in the definition of module_has_cmi_p.
This change will allow us to use the function directly in more places
that need to additional work only if generating a module CMI in the
future, allowing us to do additional work only when we know we need it.

gcc/cp/ChangeLog:

* cp-tree.h (module_has_cmi_p): Also include header units.
(module_maybe_has_cmi_p): Update comment.
* module.cc (set_defining_module): Only need to track
declarations for later exporting if the module may have a CMI.
(set_defining_module_for_partial_spec): Likewise.
* name-lookup.cc (pushdecl): Likewise.

Signed-off-by: Nathaniel Shead <nathanieloshead@gmail.com>
gcc/cp/cp-tree.h
gcc/cp/module.cc
gcc/cp/name-lookup.cc