aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/class.c
diff options
context:
space:
mode:
authorNathan Sidwell <nathan@acm.org>2020-12-08 12:34:25 -0800
committerNathan Sidwell <nathan@acm.org>2020-12-08 12:38:04 -0800
commit570c312c03e151477505c8b70b25411e52751ff4 (patch)
tree1ef81534a0ef09c89cfe29dfcb6f55d873e3ded2 /gcc/cp/class.c
parent4ed1dc1275bba89af92bfc7d97c21b376e4c29c3 (diff)
downloadgcc-570c312c03e151477505c8b70b25411e52751ff4.zip
gcc-570c312c03e151477505c8b70b25411e52751ff4.tar.gz
gcc-570c312c03e151477505c8b70b25411e52751ff4.tar.bz2
c++: Originating and instantiating module
With modules streamed entities have two new properties -- the module that declares them and the module that instantiates them. Here 'instantiate' applies to more than just templates -- for instance an implicit member fn. These may well be the same module. This adds the calls to places that need it. gcc/cp/ * class.c (layout_class_type): Call set_instantiating_module. (build_self_reference): Likewise. * decl.c (grokfndecl): Call set_originating_module. (grokvardecl): Likewise. (grokdeclarator): Likewise. * pt.c (maybe_new_partial_specialization): Call set_instantiating_module, propagate DECL_MODULE_EXPORT_P. (lookup_template_class_1): Likewise. (tsubst_function_decl): Likewise. (tsubst_decl, instantiate_template_1): Likewise. (build_template_decl): Propagate module flags. (tsubst_template_dcl): Likewise. (finish_concept_definition): Call set_originating_module. * module.cc (set_instantiating_module, set_originating_module): Stubs.
Diffstat (limited to 'gcc/cp/class.c')
-rw-r--r--gcc/cp/class.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/gcc/cp/class.c b/gcc/cp/class.c
index 2ab123d..bc0d3d6 100644
--- a/gcc/cp/class.c
+++ b/gcc/cp/class.c
@@ -6759,6 +6759,8 @@ layout_class_type (tree t, tree *virtuals_p)
TYPE_CONTEXT (base_t) = t;
DECL_CONTEXT (base_d) = t;
+ set_instantiating_module (base_d);
+
/* If the ABI version is not at least two, and the last
field was a bit-field, RLI may not be on a byte
boundary. In particular, rli_size_unit_so_far might
@@ -8738,6 +8740,7 @@ build_self_reference (void)
DECL_ARTIFICIAL (decl) = 1;
SET_DECL_SELF_REFERENCE_P (decl);
set_underlying_type (decl);
+ set_instantiating_module (decl);
if (processing_template_decl)
decl = push_template_decl (decl);