public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Ken Matsui <kmatsui@gcc.gnu.org>
To: gcc-patches@gcc.gnu.org
Cc: Ken Matsui <kmatsui@gcc.gnu.org>
Subject: [PATCH 1/8] c++, tree: Move TYPE_REF_P to tree.h
Date: Tue, 18 Jul 2023 16:12:43 -0700	[thread overview]
Message-ID: <20230718233301.28677-2-kmatsui@gcc.gnu.org> (raw)
In-Reply-To: <20230718233301.28677-1-kmatsui@gcc.gnu.org>

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 <kmatsui@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	other threads:[~2023-07-18 23:34 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-18 23:12 [PATCH 0/8] Tweak predicate macros in tree Ken Matsui
2023-07-18 23:12 ` Ken Matsui [this message]
2023-07-18 23:12 ` [PATCH 2/8] gcc: Use TYPE_REF_P Ken Matsui
2023-07-18 23:12 ` [PATCH 3/8] c++, tree: Move TYPE_PTR_P to tree.h Ken Matsui
2023-07-18 23:12 ` [PATCH 4/8] c++, tree: Move INDIRECT_TYPE_P " Ken Matsui
2023-07-18 23:12 ` [PATCH 5/8] gcc: Use INDIRECT_TYPE_P instead of POINTER_TYPE_P Ken Matsui
2023-07-18 23:12 ` [PATCH 6/8] tree: Remove POINTER_TYPE_P Ken Matsui
2023-07-18 23:12 ` [PATCH 7/8] tree: Define TYPE_REF_IS_LVALUE Ken Matsui
2023-07-18 23:12 ` [PATCH 8/8] c++, lto: Use TYPE_REF_IS_LVALUE Ken Matsui
2023-07-19  7:07 ` [PATCH 0/8] Tweak predicate macros in tree Richard Biener
2023-07-19 17:27   ` Ken Matsui

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230718233301.28677-2-kmatsui@gcc.gnu.org \
    --to=kmatsui@gcc.gnu.org \
    --cc=gcc-patches@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).