aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/module.cc
diff options
context:
space:
mode:
authorNathaniel Shead <nathanieloshead@gmail.com>2024-05-23 22:56:52 +1000
committerNathaniel Shead <nathanieloshead@gmail.com>2024-05-25 00:10:41 +1000
commit03531ec45f15aa187bbab7842a1eb6cf746a104b (patch)
tree8297a49906273e8712721668dafb2dcfbecd0bec /gcc/cp/module.cc
parent0173dcce92baa62a74929814a75edb75eeab1a54 (diff)
downloadgcc-03531ec45f15aa187bbab7842a1eb6cf746a104b.zip
gcc-03531ec45f15aa187bbab7842a1eb6cf746a104b.tar.gz
gcc-03531ec45f15aa187bbab7842a1eb6cf746a104b.tar.bz2
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>
Diffstat (limited to 'gcc/cp/module.cc')
-rw-r--r--gcc/cp/module.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/gcc/cp/module.cc b/gcc/cp/module.cc
index 3ca963c..6cd7d9e 100644
--- a/gcc/cp/module.cc
+++ b/gcc/cp/module.cc
@@ -19221,7 +19221,7 @@ set_defining_module (tree decl)
gcc_checking_assert (!DECL_LANG_SPECIFIC (decl)
|| !DECL_MODULE_IMPORT_P (decl));
- if (module_p ())
+ if (module_maybe_has_cmi_p ())
{
/* We need to track all declarations within a module, not just those
in the module purview, because we don't necessarily know yet if
@@ -19261,7 +19261,7 @@ set_defining_module (tree decl)
void
set_defining_module_for_partial_spec (tree decl)
{
- if (module_p ()
+ if (module_maybe_has_cmi_p ()
&& DECL_IMPLICIT_TYPEDEF_P (decl)
&& CLASSTYPE_TEMPLATE_SPECIALIZATION (TREE_TYPE (decl)))
vec_safe_push (partial_specializations, decl);