public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
To: gcc-patches@gcc.gnu.org
Cc: Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
Subject: [PATCH 11/14] objc: use _P() defines from tree.h
Date: Sun, 14 May 2023 01:23:18 +0200	[thread overview]
Message-ID: <20230513232321.279733-12-rep.dot.nop@gmail.com> (raw)
In-Reply-To: <20230513232321.279733-1-rep.dot.nop@gmail.com>

From: Bernhard Reutner-Fischer <aldot@gcc.gnu.org>

gcc/objc/ChangeLog:

	* objc-act.cc (objc_volatilize_decl): Use _P() defines from tree.h.
	(objc_is_global_reference_p): Ditto.
	(objc_generate_write_barrier): Ditto.
	(objc_gimplify_property_ref): Ditto.
	* objc-next-runtime-abi-01.cc (next_runtime_abi_01_receiver_is_class_object): Ditto.
	* objc-next-runtime-abi-02.cc (next_runtime_abi_02_receiver_is_class_object): Ditto.
	(next_runtime_abi_02_build_objc_method_call): Ditto.
---
 gcc/objc/objc-act.cc                 | 10 +++++-----
 gcc/objc/objc-next-runtime-abi-01.cc |  2 +-
 gcc/objc/objc-next-runtime-abi-02.cc |  4 ++--
 3 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/gcc/objc/objc-act.cc b/gcc/objc/objc-act.cc
index 08201749207..e4c49e664e1 100644
--- a/gcc/objc/objc-act.cc
+++ b/gcc/objc/objc-act.cc
@@ -2338,7 +2338,7 @@ objc_volatilize_decl (tree decl)
   /* Do not mess with variables that are 'static' or (already)
      'volatile'.  */
   if (!TREE_THIS_VOLATILE (decl) && !TREE_STATIC (decl)
-      && (TREE_CODE (decl) == VAR_DECL
+      && (VAR_P (decl)
 	  || TREE_CODE (decl) == PARM_DECL))
     {
       if (local_variables_to_volatilize == NULL)
@@ -3793,7 +3793,7 @@ objc_is_ivar_reference_p (tree expr)
 static int
 objc_is_global_reference_p (tree expr)
 {
-  return (TREE_CODE (expr) == INDIRECT_REF || TREE_CODE (expr) == PLUS_EXPR
+  return (INDIRECT_REF_P (expr) || TREE_CODE (expr) == PLUS_EXPR
 	  ? objc_is_global_reference_p (TREE_OPERAND (expr, 0))
 	  : DECL_P (expr)
 	  ? (DECL_FILE_SCOPE_P (expr) || TREE_STATIC (expr))
@@ -3812,7 +3812,7 @@ objc_generate_write_barrier (tree lhs, enum tree_code modifycode, tree rhs)
 
   /* See if we have any lhs casts, and strip them out.  NB: The lvalue casts
      will have been transformed to the form '*(type *)&expr'.  */
-  if (TREE_CODE (lhs) == INDIRECT_REF)
+  if (INDIRECT_REF_P (lhs))
     {
       outer = TREE_OPERAND (lhs, 0);
 
@@ -3864,7 +3864,7 @@ objc_generate_write_barrier (tree lhs, enum tree_code modifycode, tree rhs)
 	     || TREE_CODE (outer) == ARRAY_REF))
     outer = TREE_OPERAND (outer, 0);
 
-  if (TREE_CODE (outer) == INDIRECT_REF)
+  if (INDIRECT_REF_P (outer))
     {
       outer = TREE_OPERAND (outer, 0);
       indirect_p = 1;
@@ -9694,7 +9694,7 @@ objc_gimplify_property_ref (tree *expr_p)
   if (TREE_CODE (getter) == TARGET_EXPR)
     {
       gcc_assert (MAYBE_CLASS_TYPE_P (TREE_TYPE (getter)));
-      gcc_assert (TREE_CODE (TREE_OPERAND (getter, 0)) == VAR_DECL);
+      gcc_assert (VAR_P (TREE_OPERAND (getter, 0)));
       call_exp = TREE_OPERAND (getter, 1);
     }
 #endif
diff --git a/gcc/objc/objc-next-runtime-abi-01.cc b/gcc/objc/objc-next-runtime-abi-01.cc
index 8f68f784efe..70ab5262e17 100644
--- a/gcc/objc/objc-next-runtime-abi-01.cc
+++ b/gcc/objc/objc-next-runtime-abi-01.cc
@@ -754,7 +754,7 @@ next_runtime_abi_01_get_arg_type_list_base (vec<tree, va_gc> **argtypes,
 static tree
 next_runtime_abi_01_receiver_is_class_object (tree receiver)
 {
-  if (TREE_CODE (receiver) == VAR_DECL
+  if (VAR_P (receiver)
       && IS_CLASS (TREE_TYPE (receiver)))
     {
       /* The receiver is a variable created by build_class_reference_decl.  */
diff --git a/gcc/objc/objc-next-runtime-abi-02.cc b/gcc/objc/objc-next-runtime-abi-02.cc
index bcfc0ce8e19..6548c0078e0 100644
--- a/gcc/objc/objc-next-runtime-abi-02.cc
+++ b/gcc/objc/objc-next-runtime-abi-02.cc
@@ -1571,7 +1571,7 @@ next_runtime_abi_02_get_category_super_ref (location_t loc ATTRIBUTE_UNUSED,
 static tree
 next_runtime_abi_02_receiver_is_class_object (tree receiver)
 {
-  if (TREE_CODE (receiver) == VAR_DECL
+  if (VAR_P (receiver)
       && IS_CLASS (TREE_TYPE (receiver))
       && vec_safe_length (classrefs))
     {
@@ -1824,7 +1824,7 @@ next_runtime_abi_02_build_objc_method_call (location_t loc,
       checked.  */
   bool check_for_nil = flag_objc_nilcheck;
   if (super
-      || (TREE_CODE (receiver) == VAR_DECL
+      || (VAR_P (receiver)
 	  && TREE_TYPE (receiver) == objc_class_type))
     check_for_nil = false;
 
-- 
2.30.2


  parent reply	other threads:[~2023-05-13 23:23 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-13 23:23 [PATCH 00/14] " Bernhard Reutner-Fischer
2023-05-13 23:23 ` [PATCH 01/14] ada: " Bernhard Reutner-Fischer
2023-05-14 23:03   ` Jeff Law
2023-05-18 19:59     ` Bernhard Reutner-Fischer
2023-05-15 10:05   ` Eric Botcazou
2023-05-18 19:53     ` Bernhard Reutner-Fischer
2023-05-13 23:23 ` [PATCH 02/14] analyzer: " Bernhard Reutner-Fischer
2023-05-13 23:23 ` [PATCH 03/14] gcc/config/*: " Bernhard Reutner-Fischer
2023-05-14  8:21   ` Iain Sandoe
2023-05-15  7:46     ` Richard Biener
2023-05-13 23:23 ` [PATCH 04/14] c++: " Bernhard Reutner-Fischer
2023-06-01 15:24   ` Patrick Palka
2023-06-01 16:33     ` Bernhard Reutner-Fischer
2023-06-01 18:10       ` Bernhard Reutner-Fischer
2023-08-02 16:51         ` Patrick Palka
2023-08-08 20:31           ` Jason Merrill
2023-11-15 17:42             ` Bernhard Reutner-Fischer
2023-05-13 23:23 ` [PATCH 05/14] m2: " Bernhard Reutner-Fischer
2023-05-14  1:44   ` Gaius Mulley
2023-05-14  1:47   ` Gaius Mulley
2023-05-13 23:23 ` [PATCH 06/14] lto: " Bernhard Reutner-Fischer
2023-05-15  7:45   ` Richard Biener
2023-05-13 23:23 ` [PATCH 07/14] d: " Bernhard Reutner-Fischer
2023-05-13 23:23 ` [PATCH 08/14] fortran: " Bernhard Reutner-Fischer
2023-05-14 13:10   ` Mikael Morin
2023-05-18 15:18     ` Bernhard Reutner-Fischer
2023-05-18 19:20       ` Mikael Morin
2023-05-19 19:19         ` Bernhard Reutner-Fischer
2023-05-13 23:23 ` [PATCH 09/14] rust: " Bernhard Reutner-Fischer
2023-05-13 23:23 ` [PATCH 10/14] c: " Bernhard Reutner-Fischer
2023-05-13 23:23 ` Bernhard Reutner-Fischer [this message]
2023-05-14  8:13   ` [PATCH 11/14] objc: " Iain Sandoe
2023-05-13 23:23 ` [PATCH 12/14] go: " Bernhard Reutner-Fischer
2023-05-13 23:23 ` [PATCH 13/14] omp: " Bernhard Reutner-Fischer
2023-05-13 23:23 ` [PATCH 14/14] gcc: " Bernhard Reutner-Fischer
2023-05-15  7:45   ` Richard Biener

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=20230513232321.279733-12-rep.dot.nop@gmail.com \
    --to=rep.dot.nop@gmail.com \
    --cc=aldot@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).