diff options
author | Patrick Palka <ppalka@redhat.com> | 2020-11-02 13:19:29 -0500 |
---|---|---|
committer | Patrick Palka <ppalka@redhat.com> | 2020-11-02 13:19:29 -0500 |
commit | bebabf70a01b78d9bea65a0bbe8744a2adb6b373 (patch) | |
tree | 551fb34e5c8b4d5111aa6493f8e6555fc9821c43 /gcc/cp/cp-tree.h | |
parent | 05161256d3d2a598966ca1cf676fa0e427570f73 (diff) | |
download | gcc-bebabf70a01b78d9bea65a0bbe8744a2adb6b373.zip gcc-bebabf70a01b78d9bea65a0bbe8744a2adb6b373.tar.gz gcc-bebabf70a01b78d9bea65a0bbe8744a2adb6b373.tar.bz2 |
c++: Don't purge the satisfaction caches
The adoption of P2104 ("Disallow changing concept values") means we can
memoize the result of satisfaction indefinitely and no longer have to
clear the satisfaction caches on various events that would affect
satisfaction. To that end, this patch removes the invalidation routine
clear_satisfaction_cache and adjusts its callers appropriately.
This provides a large reduction in compile time and memory use in some
cases. For example, on the libstdc++ test std/ranges/adaptor/join.cc,
compile time and memory usage drops nearly 75%, from 7.5s/770MB to
2s/230MB, with a --enable-checking=release compiler.
gcc/cp/ChangeLog:
* class.c (finish_struct_1): Don't call clear_satisfaction_cache.
* constexpr.c (clear_cv_and_fold_caches): Likewise. Remove bool
parameter.
* constraint.cc (clear_satisfaction_cache): Remove definition.
* cp-tree.h (clear_satisfaction_cache): Remove declaration.
(clear_cv_and_fold_caches): Remove bool parameter.
* typeck2.c (store_init_value): Remove argument to
clear_cv_and_fold_caches.
gcc/testsuite/ChangeLog:
* g++.dg/cpp2a/concepts-complete1.C: Delete test that became
ill-formed after P2104.
Diffstat (limited to 'gcc/cp/cp-tree.h')
-rw-r--r-- | gcc/cp/cp-tree.h | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/gcc/cp/cp-tree.h b/gcc/cp/cp-tree.h index fdb8ee5..3b4f772 100644 --- a/gcc/cp/cp-tree.h +++ b/gcc/cp/cp-tree.h @@ -7831,7 +7831,6 @@ extern tree evaluate_concept_check (tree, tsubst_flags_t); extern tree satisfy_constraint_expression (tree); extern bool constraints_satisfied_p (tree); extern bool constraints_satisfied_p (tree, tree); -extern void clear_satisfaction_cache (); extern bool* lookup_subsumption_result (tree, tree); extern bool save_subsumption_result (tree, tree, bool); extern tree find_template_parameters (tree, tree); @@ -7901,7 +7900,7 @@ extern bool var_in_maybe_constexpr_fn (tree); extern void explain_invalid_constexpr_fn (tree); extern vec<tree> cx_error_context (void); extern tree fold_sizeof_expr (tree); -extern void clear_cv_and_fold_caches (bool = true); +extern void clear_cv_and_fold_caches (void); extern tree unshare_constructor (tree CXX_MEM_STAT_INFO); /* An RAII sentinel used to restrict constexpr evaluation so that it |