Commit 658efded authored by Jeff Chapman's avatar Jeff Chapman

update to current devel/c++-modules

6fded9a059ed1f83ba354176fac67603b83036e5
parent d15cefa3
2020-04-23 Nathan Sidwell <[email protected]>
Stream definitions after decls.
gcc/cp
* module.cc (module_state::write_cluster): Break out definition
streaming to separate loop.
gcc/testsuite/
* g++.dg/modules/member-def-[12]_c.C: Adjust scans, oh for CHECK-DAG.
Stream node types last
gcc/cp/
* module.cc (trees_{in,out}::core_vals): Move type streaming to
end.
gcc/testsuite/
* g++.dg/modules/indirect-4_c.C: Adjust scan.
2020-04-22 Nathan Sidwell <[email protected]>
Stream imports at start of cluster
gcc/cp/
* module.cc (trees_out::importedness): New checker.
(depset::hash::add_dependency): Add imports.
(depset::tarjan::connect): Skip imports.
(module_state::{read,write}_cluster): Seed imports before the
cluster itself.
gcc/testsuite/
* g++.dg/modules/class-3_[bd].C: Adjust scans.
* g++.dg/modules/imp-member-[12]_[ce].C: Adjust scans.
* g++.dg/modules/member-def-2_c.C: Adjust scans.
* g++.dg/modules/vmort-2_c.C: Adjust scans.
2020-04-21 Nathan Sidwell <[email protected]>
Don't stream DECL_ODR_USED or TREE_ASM_WRITTEN
gcc/cp/
* module.cc (trees_{in,out}::core_values): Don't stream
base.asm_written_flag.
(trees_{in,out}::lang_decl_bools): Don't stream u.base.odr_used.
Remove DECL_MODULE_PARTITION_P, it is not needed.
gcc/cp/
* cp-tree.h (DECL_MODULE_PARTITION_P): Delete.
(lang_decl_base): Remove module_partition_p bitfield.
* decl.c (duplicate_decls): No need to check or reset it.
* lex.c (cxx_dup_lang_specific): No need to reset it.
* pt.c (build_template_decl): No need to check it.
(tsubst_template_decl): Likewise, or reset it.
* module.cc (trees_in::decl_value): No need to set it.
(trees_out::decl_node): No need to check it.
(depset::hash::make_dependency): Likewise, Adjust import marking
code.
(set_instantiating_module): No need to reset it.
2020-04-17 Nathan Sidwell <[email protected]>
Merge master a28edad3da5c59f09565d3d42e20be1a924986c4
......
......@@ -1730,15 +1730,6 @@ check_constraint_info (tree t)
#define DECL_MODULE_IMPORT_P(NODE) \
(DECL_LANG_SPECIFIC (DECL_MODULE_CHECK (NODE))->u.base.module_import_p)
/* True if we're the primary interface and this decl was imported from
a partition, or is in the PMF (not implemented). */
// FIXME: We can probably elide this, as we can simply find the
// importing module and note it is a partition. Plus we cannot set
// this on a namespace, because that'd confuse other users of the same
// namespace
#define DECL_MODULE_PARTITION_P(NODE) \
(DECL_LANG_SPECIFIC (DECL_MODULE_CHECK (NODE))->u.base.module_partition_p)
/* True if this decl is in the entity hash & array. This means that
some variant was imported, even if DECL_MODULE_IMPORT_P is false. */
#define DECL_MODULE_ENTITY_P(NODE) \
......@@ -2807,9 +2798,6 @@ struct GTY(()) lang_decl_base {
unsigned module_purview_p : 1; /* in module purview (not GMF) */
unsigned module_import_p : 1; /* from an import */
unsigned module_partition_p : 1; /* from an imported
partition, or in the
PMF. */
unsigned module_entity_p : 1; /* is in the entitity ary &
hash. */
/* Has specializations or members yet to load. */
......@@ -2819,7 +2807,7 @@ struct GTY(()) lang_decl_base {
/* Is in the decl-attached hash table, (with attached decls). */
unsigned attached_decls_p : 1;
/* 9 spare bits. */
/* 10 spare bits. */
};
/* True for DECL codes which have template info and access. */
......
......@@ -2844,10 +2844,8 @@ duplicate_decls (tree newdecl, tree olddecl, bool newdecl_is_friend)
if (DECL_TEMPLATE_RESULT (tmpl) == olddecl)
{
DECL_MODULE_PURVIEW_P (tmpl) = DECL_MODULE_PURVIEW_P (olddecl);
gcc_checking_assert (!DECL_MODULE_IMPORT_P (olddecl)
&& !DECL_MODULE_PARTITION_P (olddecl));
gcc_checking_assert (!DECL_MODULE_IMPORT_P (olddecl));
DECL_MODULE_IMPORT_P (tmpl) = false;
DECL_MODULE_PARTITION_P (tmpl) = false;
}
}
......
......@@ -2186,6 +2186,7 @@ decl_needed_p (tree decl)
emitted; they may be referred to from other object files. */
if (TREE_PUBLIC (decl) && !DECL_COMDAT (decl) && !DECL_REALLY_EXTERN (decl))
return true;
/* Functions marked "dllexport" must be emitted so that they are
visible to other DLLs. */
if (flag_keep_inline_dllexport
......
......@@ -1007,7 +1007,6 @@ cxx_dup_lang_specific_decl (tree node)
DECL_LANG_SPECIFIC (node) = ld;
DECL_MODULE_ENTITY_P (node) = false;
DECL_MODULE_IMPORT_P (node) = false;
DECL_MODULE_PARTITION_P (node) = false;
DECL_ATTACHED_DECLS_P (node) = false;
if (GATHER_STATISTICS)
......
This diff is collapsed.
......@@ -4847,8 +4847,7 @@ build_template_decl (tree decl, tree parms, bool member_template_p)
if (DECL_LANG_SPECIFIC (decl))
{
DECL_MODULE_PURVIEW_P (tmpl) = DECL_MODULE_PURVIEW_P (decl);
gcc_checking_assert (!DECL_MODULE_IMPORT_P (decl)
&& !DECL_MODULE_PARTITION_P (decl));
gcc_checking_assert (!DECL_MODULE_IMPORT_P (decl));
}
}
......@@ -14089,10 +14088,8 @@ tsubst_template_decl (tree t, tree args, tsubst_flags_t complain,
if (DECL_LANG_SPECIFIC (inner))
{
DECL_MODULE_PURVIEW_P (r) = DECL_MODULE_PURVIEW_P (inner);
gcc_checking_assert (!DECL_MODULE_IMPORT_P (inner)
&& !DECL_MODULE_PARTITION_P (inner));
gcc_checking_assert (!DECL_MODULE_IMPORT_P (inner));
DECL_MODULE_IMPORT_P (r) = false;
DECL_MODULE_PARTITION_P (r) = false;
}
}
......
......@@ -8,7 +8,8 @@ export inline void Frob (X &q)
q.b = q.a;
}
// { dg-final { scan-lang-dump {Writing implicit typedef type_decl:'::[email protected]:.'} module } }
// { dg-final { scan-lang-dump {Wrote import:-1 type_decl:'::[email protected]:.'} module } }
// { dg-final { scan-lang-dump {Indirect:-2 decl's type record_type:'::[email protected]:.'} module } }
// { dg-final { scan-lang-dump {Wrote import:-[0-9]* type_decl:'::[email protected]:.'@One} module } }
// { dg-final { scan-lang-dump {Indirect:-[0-9]* decl's type record_type:'::[email protected]:.'} module } }
// { dg-final { scan-lang-dump {Wrote import:-[0-9]* type_decl:'::[email protected]:.'@One} module } }
......
......@@ -19,8 +19,7 @@ int main ()
return 0;
}
// { dg-final { scan-lang-dump {Imported:-[0-9]* type_decl:'::[email protected]:.'@One} module } }
// { dg-final { scan-lang-dump {Indirect:-[0-9]* decl's type record_type:'::[email protected]:.'} module } }
// { dg-final { scan-lang-dump {Read implicit typedef type_decl:'::[email protected]:.'} module } }
// { dg-final { scan-lang-dump {Imported:-1 type_decl:'::[email protected]:.'@One} module } }
// { dg-final { scan-lang-dump {Indirect:-2 decl's type record_type:'::[email protected]:.'} module } }
// { dg-final { scan-lang-dump {Read member:-[0-9]* field_decl:'::[email protected]:.::a'} module } }
// { dg-final { scan-lang-dump {Read member:-[0-9]* field_decl:'::[email protected]:.::b'} module } }
......@@ -6,5 +6,5 @@ void fn ()
D d; // reads in C::C implicit ctor
}
// { dg-final { scan-lang-dump {Read:-1's named merge key \(new\) function_decl:'::[email protected]:.::__ct '\n} module } }
// { dg-final { scan-lang-dump {Read:-[0-9]*'s named merge key \(new\) function_decl:'::[email protected]:.::__ct '\n} module } }
// { dg-final { scan-lang-dump {Adding implicit member '::[email protected]:.::__ct @B:.} module } }
......@@ -11,5 +11,5 @@ void fn2 ()
D d; // merges implicit C::C
}
// { dg-final { scan-lang-dump {Read:-1's named merge key \(matched\) function_decl:'::[email protected]:.::__ct '\n} module } }
// { dg-final { scan-lang-dump {Read:-[0-9]*'s named merge key \(matched\) function_decl:'::[email protected]:.::__ct '\n} module } }
// { dg-final { scan-lang-dump-not {Adding implicit member '::[email protected]:.::__ct @B:.} module } }
......@@ -6,9 +6,9 @@ void fn ()
D d; // reads in C::C implicits
}
// { dg-final { scan-lang-dump-times {Read:-1's named merge key \(new\) function_decl:'::[email protected]:.::__dt '\n} 1 module } }
// { dg-final { scan-lang-dump-times {Read:-[0-9]*'s named merge key \(new\) function_decl:'::[email protected]:.::__dt '\n} 1 module } }
// { dg-final { scan-lang-dump-times {Adding implicit member '::[email protected]:.::__dt @B:.} 1 module } }
// { dg-final { scan-lang-dump-times {Read:-1's named merge key \(new\) function_decl:'::[email protected]:.::__ct '\n} 3 module } }
// { dg-final { scan-lang-dump-times {Read:-[0-9]*'s named merge key \(new\) function_decl:'::[email protected]:.::__ct '\n} 3 module } }
// { dg-final { scan-lang-dump-times {Adding implicit member '::[email protected]:.::__ct @B:.} 3 module } }
// { dg-final { scan-lang-dump-times {Read:-1's named merge key \(new\) function_decl:'::[email protected]:.::operator='\n} 2 module } }
// { dg-final { scan-lang-dump-times {Read:-[0-9]*'s named merge key \(new\) function_decl:'::[email protected]:.::operator='\n} 2 module } }
// { dg-final { scan-lang-dump-times {Adding implicit member '::[email protected]:.::[email protected]:.} 2 module } }
......@@ -10,7 +10,7 @@ int main ()
}
// { dg-final { scan-lang-dump {Lazily binding '::[email protected]:.::quux'@'bar' section:} module } }
// { dg-final { scan-lang-dump {>Loading entity foo\[1\] section:1} module } }
// { dg-final { scan-lang-dump {>Loading entity foo\[2\] section:1} module } }
// { dg-final { scan-lang-dump {Imported:-[0-9]* template_decl:'::[email protected]:.::template [email protected]:.'@foo} module } }
// { dg-final { scan-lang-dump {Reading definition function_decl '::[email protected]:.::[email protected]:.<0x1>::[email protected]:.<0x2>'} module } }
......
......@@ -12,5 +12,5 @@ export auto foo ()
}
// { dg-final { scan-lang-dump {Reading 1 pending members keyed to foo:part1\[0\] '::[email protected]:part1:1'} module } }
// { dg-final { scan-lang-dump { Cluster members:\n \[0\]=decl definition '::[email protected]:part1:1'\n \[1\]=decl definition '::[email protected]:part1:1::[email protected]:part1:1'\n \[2\]=decl declaration '::[email protected]:part1:1::[email protected]:part1:1::__dt '\n( \[.\]=decl declaration '::[email protected]:part1:1::[email protected]:part1:1::__ct '\n)* \[6\]=decl declaration '::[email protected]:part1:1::[email protected]:part1:1::[email protected]:part2:2'\n \[7\]=decl declaration '::[email protected]:part1:1::__as_base @foo:part1:1'\n \[8\]=decl declaration '::[email protected]:part1:1::frob@foo:part1:1'\n \[9\]=binding '::frob'\n} module } }
// { dg-final { scan-lang-dump { Cluster members:\n \[0\]=decl definition '::[email protected]:part1:1'\n \[1\]=decl definition '::[email protected]:part1:1::[email protected]:part1:1'\n \[2\]=decl declaration '::[email protected]:part1:1::[email protected]:part1:1::__dt '\n( \[.\]=decl declaration '::[email protected]:part1:1::[email protected]:part1:1::__ct '\n)* \[6\]=decl declaration '::[email protected]:part1:1::[email protected]:part1:1::[email protected]:part2:2'\n \[7\]=decl declaration '::[email protected]:part1:1::[email protected]:part1:1'\n \[8\]=decl declaration '::[email protected]:part1:1::__as_base @foo:part1:1'\n \[9\]=binding '::frob'\n} module } }
// { dg-final { scan-lang-dump {Pendings 0} module } }
......@@ -7,9 +7,9 @@ export import :part2;
export import :part1;
// { dg-final { scan-lang-dump { Cluster members:\n \[0\]=decl definition '::[email protected]:part1:1'\n \[1\]=decl declaration '::[email protected]:part1:1::__as_base @foo:part1:1'\n \[2\]=decl declaration '::[email protected]:part1:1::[email protected]:part1:1'\n \[3\]=decl definition '::[email protected]:part1:1::member@foo:part1:1'\n \[4\]=binding '::frob'\n} module } }
// { dg-final { scan-lang-dump { Cluster members:\n \[0\]=decl definition '::[email protected]:part1:1'\n \[1\]=decl declaration '::[email protected]:part1:1::[email protected]:part1:1'\n \[2\]=decl definition '::[email protected]:part1:1::[email protected]:part1:1'\n \[3\]=decl declaration '::[email protected]:part1:1::__as_base @foo:part1:1'\n \[4\]=binding '::frob'\n} module } }
// { dg-final { scan-lang-dump {Bindings 1} module } }
// { dg-final { scan-lang-dump {Pendings 0} module } }
// { dg-final { scan-lang-dump {Read:-1's named merge key .matched. function_decl:'::[email protected]:part1:1::member'} module } }
// { dg-final { scan-lang-dump {Read:-[0-9]*'s named merge key .matched. function_decl:'::[email protected]:part1:1::member'} module } }
// { dg-final { scan-assembler-not {_ZN4frob6memberEv:} } }
......@@ -18,4 +18,4 @@ int main ()
}
// { dg-final { scan-lang-dump {Loading entity voldy\[1\] section:1} module } }
// { dg-final { scan-lang-dump {Indirect:-8 decl's type record_type:'::[email protected]:.::[email protected]:.'} module } }
// { dg-final { scan-lang-dump {Indirect:-[0-9]* decl's type record_type:'::[email protected]:.::[email protected]:.'} module } }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment