This patch moves TYPE_REF_P from cp/cp-tree.h to tree.h to simplify the
same code as it and to declare TYPE_REF_IS_LVALUE that determines if a
type is a C++ lvalue reference.

gcc/cp/ChangeLog:

        * cp-tree.h (TYPE_REF_P): Remove.

gcc/ChangeLog:

        * tree.h (TYPE_REF_P): Define.

Signed-off-by: Ken Matsui <kmat...@gcc.gnu.org>
---
 gcc/cp/cp-tree.h | 4 ----
 gcc/tree.h       | 4 ++++
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/gcc/cp/cp-tree.h b/gcc/cp/cp-tree.h
index 3de0e154c12..8c96d868650 100644
--- a/gcc/cp/cp-tree.h
+++ b/gcc/cp/cp-tree.h
@@ -4710,10 +4710,6 @@ get_vec_init_expr (tree t)
 #define TYPE_PTR_P(NODE)                       \
   (TREE_CODE (NODE) == POINTER_TYPE)
 
-/* Returns true if NODE is a reference.  */
-#define TYPE_REF_P(NODE)                       \
-  (TREE_CODE (NODE) == REFERENCE_TYPE)
-
 /* Returns true if NODE is a pointer or a reference.  */
 #define INDIRECT_TYPE_P(NODE)                  \
   (TYPE_PTR_P (NODE) || TYPE_REF_P (NODE))
diff --git a/gcc/tree.h b/gcc/tree.h
index 4c04245e2b1..ca3e0ce8f5e 100644
--- a/gcc/tree.h
+++ b/gcc/tree.h
@@ -678,6 +678,10 @@ extern void omp_clause_range_check_failed (const_tree, 
const char *, int,
 #define AGGREGATE_TYPE_P(TYPE) \
   (TREE_CODE (TYPE) == ARRAY_TYPE || RECORD_OR_UNION_TYPE_P (TYPE))
 
+/* Nonzero if this type is a reference.  */
+#define TYPE_REF_P(NODE)                       \
+  (TREE_CODE (NODE) == REFERENCE_TYPE)
+
 /* Nonzero if TYPE represents a pointer or reference type.
    (It should be renamed to INDIRECT_TYPE_P.)  Keep these checks in
    ascending code order.  */
-- 
2.41.0

Reply via email to