public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc(refs/users/ppalka/heads/wip)] c++: Flatten ATOMIC_CONSTR
@ 2020-11-02 21:31 Patrick Palka
  0 siblings, 0 replies; only message in thread
From: Patrick Palka @ 2020-11-02 21:31 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:a4d1465014295f2eb66eb95bd7cb744ceed2f5cf

commit a4d1465014295f2eb66eb95bd7cb744ceed2f5cf
Author: Patrick Palka <ppalka@redhat.com>
Date:   Tue Oct 27 16:56:15 2020 -0400

    c++: Flatten ATOMIC_CONSTR
    
    gcc/cp/ChangeLog:
    
            * constraint.cc (normalize_atom):
            * cp-tree.def (ATOMIC_CONSTR):
            * cp-tree.h (CONSTR_EXPR):
            (CONSTR_CONTEXT):
            (ATOMIC_CONSTR_EXPR):

Diff:
---
 gcc/cp/constraint.cc |  5 +----
 gcc/cp/cp-tree.def   |  2 +-
 gcc/cp/cp-tree.h     | 10 +++++++---
 3 files changed, 9 insertions(+), 8 deletions(-)

diff --git a/gcc/cp/constraint.cc b/gcc/cp/constraint.cc
index 5866387fbe3..28c5200b4f1 100644
--- a/gcc/cp/constraint.cc
+++ b/gcc/cp/constraint.cc
@@ -765,10 +765,7 @@ normalize_atom (tree t, tree args, norm_info info)
   /* Build the parameter mapping for the atom.  */
   tree map = build_parameter_mapping (t, args, info.in_decl);
 
-  /* Build a new info object for the atom.  */
-  tree ci = build_tree_list (t, info.context);
-
-  return build1 (ATOMIC_CONSTR, ci, map);
+  return build2 (ATOMIC_CONSTR, info.context, map, t);
 }
 
 /* Returns the normal form of an expression. */
diff --git a/gcc/cp/cp-tree.def b/gcc/cp/cp-tree.def
index a188576013b..59d44941c57 100644
--- a/gcc/cp/cp-tree.def
+++ b/gcc/cp/cp-tree.def
@@ -536,7 +536,7 @@ DEFTREECODE (NESTED_REQ, "nested_req", tcc_expression, 1)
    ATOMIC_CONSTR_EXPR has the expression to be evaluated.
    ATOMIC_CONSTR_PARMS is the parameter mapping for the atomic constraint
    and is stored in the type field.  */
-DEFTREECODE (ATOMIC_CONSTR, "atomic_constr", tcc_expression, 1)
+DEFTREECODE (ATOMIC_CONSTR, "atomic_constr", tcc_expression, 2)
 
 /* The conjunction and disjunction of two constraints, respectively.
    Operands are accessed using TREE_OPERAND. The third operand provides
diff --git a/gcc/cp/cp-tree.h b/gcc/cp/cp-tree.h
index 334424770ef..b3848a1d891 100644
--- a/gcc/cp/cp-tree.h
+++ b/gcc/cp/cp-tree.h
@@ -1580,14 +1580,18 @@ check_constraint_info (tree t)
 
 /* The expression evaluated by the constraint.  */
 #define CONSTR_EXPR(NODE) \
-  TREE_PURPOSE (CONSTR_INFO (NODE))
+  (TREE_CODE (NODE) == ATOMIC_CONSTR \
+   ? ATOMIC_CONSTR_EXPR (NODE) \
+   : TREE_PURPOSE (TREE_TYPE (CONSTR_CHECK (NODE))))
 
 /* The expression or declaration from which this constraint was normalized.
    This is a TREE_LIST whose TREE_VALUE is either a template-id expression
    denoting a concept check or the declaration introducing the constraint.
    These are chained to other context objects.  */
 #define CONSTR_CONTEXT(NODE) \
-  TREE_VALUE (CONSTR_INFO (NODE))
+  (TREE_CODE (NODE) == ATOMIC_CONSTR \
+   ? TREE_TYPE (NODE) \
+   : TREE_VALUE (TREE_TYPE (CONSTR_CHECK (NODE))))
 
 /* The parameter mapping for an atomic constraint. */
 #define ATOMIC_CONSTR_MAP(NODE) \
@@ -1595,7 +1599,7 @@ check_constraint_info (tree t)
 
 /* The expression of an atomic constraint. */
 #define ATOMIC_CONSTR_EXPR(NODE) \
-  CONSTR_EXPR (ATOMIC_CONSTR_CHECK (NODE))
+  TREE_OPERAND (ATOMIC_CONSTR_CHECK (NODE), 1)
 
 /* The concept of a concept check. */
 #define CHECK_CONSTR_CONCEPT(NODE) \


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2020-11-02 21:31 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-02 21:31 [gcc(refs/users/ppalka/heads/wip)] c++: Flatten ATOMIC_CONSTR Patrick Palka

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).