From patchwork Sat May 13 23:23:18 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bernhard Reutner-Fischer X-Patchwork-Id: 1781000 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=sourceware.org; envelope-from=gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.a=rsa-sha256 header.s=default header.b=seYfR4bE; dkim-atps=neutral Received: from sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4QJhZJ11DJz20KF for ; Sun, 14 May 2023 09:25:28 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 20364385292E for ; Sat, 13 May 2023 23:25:26 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 20364385292E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1684020326; bh=P1EfbTsqHUp1fAIX8qMLreTNngcPypHSiUr0Cj4Go/E=; h=To:Cc:Subject:Date:In-Reply-To:References:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From:Reply-To:From; b=seYfR4bEYUzZKypj2WQS8hhgRjAqzUmre6eLvUjtRAybhBpzC9CWlOfF3Do9mlISC nq83+Dc82JZheVSxYFTtBp1AJvfepQOTHLcPc2O8/eukzpNvLRsF/x2etQs5zG9LwN afZT/xfpOhN8TO9y98uPZENYF7GtEOqnK/0L/Gr0= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-ej1-x631.google.com (mail-ej1-x631.google.com [IPv6:2a00:1450:4864:20::631]) by sourceware.org (Postfix) with ESMTPS id B0F483858426; Sat, 13 May 2023 23:23:54 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org B0F483858426 Received: by mail-ej1-x631.google.com with SMTP id a640c23a62f3a-9659c5b14d8so1887605966b.3; Sat, 13 May 2023 16:23:54 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684020233; x=1686612233; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=P1EfbTsqHUp1fAIX8qMLreTNngcPypHSiUr0Cj4Go/E=; b=B8d10l9YBNVVMTeTbpHyXQ1cZs1PDJBBfWmKugcGDLTaIrHN2f88PfmykYH4zmCH4f cuCBtgT6IktKbP3f8EoTtN+90U2pi9Uy/6rCgdGddKivZnHR9eotOzCTGqfCQI0kvEap R5gP3tAI+CDDzJHhuW4SMz9KVE+S5U5Jw7tsw9sfeZdUDOtGVvn/F7qjvEQwA+MT+Clh H0UtABwJlf06xMuI1ZDHBLoQlUU42gcgUFEnZOcc+vk43wCctW2AZRnTj64ykS9T2zhw GCC08v210jyfy1cYxlxwdTZcMIIGHzcS9raiAFlSteI17RF8h9Zl0wlxl8GhyKp/uYXK USsg== X-Gm-Message-State: AC+VfDw57d0hsq04j4RVg78ou+YzavpMLxz1yeDAfkP+mviOqjFeaj/8 3Kd8nEN/SYFmzN+r/yC8HcUEWHPHwls= X-Google-Smtp-Source: ACHHUZ4c2uc4e+MUGX4hqBk5WGe7gujEggszj3RtXaPEbMf+ewVza4mLiD08WtEyCdt3QfJ+wMecZQ== X-Received: by 2002:a17:907:c26:b0:966:238a:c93 with SMTP id ga38-20020a1709070c2600b00966238a0c93mr26464554ejc.68.1684020232686; Sat, 13 May 2023 16:23:52 -0700 (PDT) Received: from nbbrfq ([2001:871:227:ce8b:afc3:c345:e1dd:564e]) by smtp.gmail.com with ESMTPSA id m26-20020a17090677da00b0096ae4451c65sm1239461ejn.157.2023.05.13.16.23.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 13 May 2023 16:23:48 -0700 (PDT) Received: from b by nbbrfq with local (Exim 4.96) (envelope-from ) id 1pxyaa-001Amv-0Y; Sun, 14 May 2023 01:23:48 +0200 To: gcc-patches@gcc.gnu.org Cc: Bernhard Reutner-Fischer Subject: [PATCH 11/14] objc: use _P() defines from tree.h Date: Sun, 14 May 2023 01:23:18 +0200 Message-Id: <20230513232321.279733-12-rep.dot.nop@gmail.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230513232321.279733-1-rep.dot.nop@gmail.com> References: <20230513232321.279733-1-rep.dot.nop@gmail.com> MIME-Version: 1.0 X-Spam-Status: No, score=-10.2 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Bernhard Reutner-Fischer via Gcc-patches From: Bernhard Reutner-Fischer Reply-To: Bernhard Reutner-Fischer Errors-To: gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org Sender: "Gcc-patches" From: Bernhard Reutner-Fischer 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 **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;