aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/cp-tree.h
diff options
context:
space:
mode:
authorAndrew Sutton <asutton@lock3software.com>2019-10-24 15:03:49 +0000
committerAndrew Sutton <asutton@gcc.gnu.org>2019-10-24 15:03:49 +0000
commit79c05c2bc49b4880ec4789d4078178e27821f268 (patch)
treee26a1b04787b484f4bffdf08b8b1ebb70414beb5 /gcc/cp/cp-tree.h
parent4352288a3df915575a2b820f702242908740106f (diff)
downloadgcc-79c05c2bc49b4880ec4789d4078178e27821f268.zip
gcc-79c05c2bc49b4880ec4789d4078178e27821f268.tar.gz
gcc-79c05c2bc49b4880ec4789d4078178e27821f268.tar.bz2
Finish moving constraint and logic functionality of out pt.c.
Also, reimplement and re-enable subsumption caching. gcc/cp/ * config-lang.in (gtfiles): Add logic.cc. * constraint.cc (atomic_constraints_identical_p): Add assertions. (hash_atomic_constraint): Likewise. (constraints_equivalent_p): New. (inchash::add_constraint): New. (iterative_hash_constraint): New. (decl_constraints): Moved from pt.c. (get_constraints): Likewise. (set_constraints): Likewise. (remove_constraints): Likewise. * cp-tree.h (CONSTR_P): New. (init_constraint_processing): Remove. (constraints_equivalent_p, iterative_hash_constraint): Declare. * decl.c (cxx_init_decl_processing): Don't initialize constraints. * logic.cc (subsumption_entry): Moved from pt.c. (subsumption_hasher): Likewise. (subsumption_cache): Likewise. (lookup_subsumption): Likewise. (save_subsumption): Likewise. (subsumes_constraints_nonnull): Use subsumption cache. * pt.c: Move aforementioned declarations out of this file. (init_constraint_processing): Remove. From-SVN: r277407
Diffstat (limited to 'gcc/cp/cp-tree.h')
-rw-r--r--gcc/cp/cp-tree.h11
1 files changed, 9 insertions, 2 deletions
diff --git a/gcc/cp/cp-tree.h b/gcc/cp/cp-tree.h
index e307ac8..7e0c41c 100644
--- a/gcc/cp/cp-tree.h
+++ b/gcc/cp/cp-tree.h
@@ -1551,6 +1551,12 @@ check_constraint_info (tree t)
#define PLACEHOLDER_TYPE_CONSTRAINTS(NODE) \
DECL_SIZE_UNIT (TYPE_NAME (NODE))
+/* True if NODE is a constraint. */
+#define CONSTR_P(NODE) \
+ (TREE_CODE (NODE) == ATOMIC_CONSTR \
+ || TREE_CODE (NODE) == CONJ_CONSTR \
+ || TREE_CODE (NODE) == DISJ_CONSTR)
+
/* Valid for any normalized constraint. */
#define CONSTR_CHECK(NODE) \
TREE_CHECK3 (NODE, ATOMIC_CONSTR, CONJ_CONSTR, DISJ_CONSTR)
@@ -7693,7 +7699,6 @@ struct diagnosing_failed_constraint
/* in constraint.cc */
-extern void init_constraint_processing ();
extern cp_expr finish_constraint_or_expr (location_t, cp_expr, cp_expr);
extern cp_expr finish_constraint_and_expr (location_t, cp_expr, cp_expr);
extern cp_expr finish_constraint_primary_expr (cp_expr);
@@ -7761,8 +7766,10 @@ extern bool subsumes_constraints (tree, tree);
extern bool strictly_subsumes (tree, tree, tree);
extern bool weakly_subsumes (tree, tree, tree);
extern int more_constrained (tree, tree);
+extern bool constraints_equivalent_p (tree, tree);
extern bool atomic_constraints_identical_p (tree, tree);
-extern hashval_t hash_atomic_constraint (tree);
+extern hashval_t iterative_hash_constraint (tree, hashval_t);
+extern hashval_t hash_atomic_constraint (tree);
extern void diagnose_constraints (location_t, tree, tree);
/* in logic.cc */