aboutsummaryrefslogtreecommitdiff
path: root/gcc/objc
diff options
context:
space:
mode:
authorBernhard Reutner-Fischer <aldot@gcc.gnu.org>2023-05-14 01:00:00 +0200
committerBernhard Reutner-Fischer <aldot@gcc.gnu.org>2023-05-18 21:50:46 +0200
commit92ce0786da32b868545e8ca5f93e785e95d4019c (patch)
tree67076ad451ff30039d88dc6e3f5d8fb2dc859459 /gcc/objc
parent9157b213f560fc7539a429075a3f1b6826e45523 (diff)
downloadgcc-92ce0786da32b868545e8ca5f93e785e95d4019c.zip
gcc-92ce0786da32b868545e8ca5f93e785e95d4019c.tar.gz
gcc-92ce0786da32b868545e8ca5f93e785e95d4019c.tar.bz2
objc: use _P() defines from tree.h
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.
Diffstat (limited to 'gcc/objc')
-rw-r--r--gcc/objc/objc-act.cc10
-rw-r--r--gcc/objc/objc-next-runtime-abi-01.cc2
-rw-r--r--gcc/objc/objc-next-runtime-abi-02.cc4
3 files changed, 8 insertions, 8 deletions
diff --git a/gcc/objc/objc-act.cc b/gcc/objc/objc-act.cc
index 0820174..e4c49e6 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 8f68f78..70ab5262 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 bcfc0ce..6548c00 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;