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 7/8] tree: Define TYPE_REF_IS_LVALUE
Date: Tue, 18 Jul 2023 16:12:49 -0700	[thread overview]
Message-ID: <20230718233301.28677-8-kmatsui@gcc.gnu.org> (raw)
In-Reply-To: <20230718233301.28677-1-kmatsui@gcc.gnu.org>

This patch defines TYPE_REF_IS_LVALUE to determine if a type is a C++
lvalue reference.

gcc/ChangeLog:

	* tree.h (TYPE_REF_IS_LVALUE): Define.

Signed-off-by: Ken Matsui <kmatsui@gcc.gnu.org>
---
 gcc/tree.h | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/gcc/tree.h b/gcc/tree.h
index 347e676e737..0b2cb894241 100644
--- a/gcc/tree.h
+++ b/gcc/tree.h
@@ -1054,6 +1054,10 @@ extern void omp_clause_range_check_failed (const_tree, const char *, int,
 #define TYPE_REF_IS_RVALUE(NODE) \
   (REFERENCE_TYPE_CHECK (NODE)->base.private_flag)
 
+/* True if reference type NODE is a C++ lvalue reference.  */
+#define TYPE_REF_IS_LVALUE(NODE) \
+  (TYPE_REF_P (NODE) && !TYPE_REF_IS_RVALUE (NODE))
+
 /* Nonzero in a _DECL if the use of the name is defined as a
    deprecated feature by __attribute__((deprecated)).  */
 #define TREE_DEPRECATED(NODE) \
-- 
2.41.0


  parent reply	other threads:[~2023-07-18 23:44 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 ` [PATCH 1/8] c++, tree: Move TYPE_REF_P to tree.h Ken Matsui
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 ` Ken Matsui [this message]
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-8-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).