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: 93625 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp6015965vqo; Sat, 13 May 2023 16:27:58 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5Rmb0Gbr4QkM7FJqUQXTuyNElKYAx1tBQZ6FtSB/XkZ0MjGKPSlYVc45pJfBtFOzSOzHna X-Received: by 2002:a05:6402:1116:b0:50b:cb85:f938 with SMTP id u22-20020a056402111600b0050bcb85f938mr21984874edv.27.1684020477855; Sat, 13 May 2023 16:27:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684020477; cv=none; d=google.com; s=arc-20160816; b=sU8p3qpRYRtlC3+R/ZAJ7LwiDxNjffrXH+ewMdb3H++TLmI9Jm7sWH8hQOhYrYZ8DH JQXwutbW8hKfkAqTUnpCSHKi45Nnw04y975NUvlOa/O8ibpg3xpOCUoltErTIlbgLHcz 8AwCfIsFnwbjS2uPgxBMg+SbJAF6mcV/Kh1/B2o1tdZnFcQD9k7bTelqrdIO8q8v8Hkm JW4mxY4+Cim998TLZQmGdJx1cBIkOrE+5U5YHk7QCT/9Cfhq5xQsB/sQzL/dX/53v4Yo qrEZizbsKyjoirqYo9fPwPrb2DZh+7c38hzonTloNB18Vlov6ljtBqC1Thn3+L71DP78 fp0Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:reply-to:from:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence :content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:dmarc-filter:delivered-to :dkim-signature:dkim-filter; bh=P1EfbTsqHUp1fAIX8qMLreTNngcPypHSiUr0Cj4Go/E=; b=CWOs3QNsGq2y9Nu/T0BdFrg3AKSdwvKWjlDrOmgsMewgC4TL4CXPdUf1HQ1S5SHRvu FEIatj6u1cWUktAE5XnMvbwNKTCg5XL7bkrkT4lIYfxMLZS2ypr+L5JabflQH/PxAuJS HbUoaQ13WXVpFXvFE5yaGRlTCfFYlThWlix9wlBGX4PQ65+VPwvwWx46Gwu1dzJfRQAd a20MMzu0olrgNP3Lu7ikgPVGdPKSb6aSWvBNjzgbxw8aFB+NUI2cHCH7fuNlqR8D6u65 2TdwHRvq78s7juW80Kos+soYtZYrOkTWeoPkDmBbRwCiAUaiOBuyq4EoRpVs0++zWAFl /TzA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=EaMCShIo; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from sourceware.org (server2.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id n14-20020aa7c44e000000b0050bdd7b8a9csi9425719edr.438.2023.05.13.16.27.57 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 13 May 2023 16:27:57 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=EaMCShIo; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 3CAF63851C12 for ; Sat, 13 May 2023 23:25:51 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 3CAF63851C12 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1684020351; 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=EaMCShIov5ilv2W3YcMRgzOZK4ZydvSV6vaR0tHjKGaxil6hm3uny+BpznXn+Ru9o qllPhO0COMg/f0xSww59/Lu825Mv7QzFrF6pwevuKQdjFAPBFBZ5jUANBmWKarFHHW 0XINtZ5biiD4Vbi4dKkdYeUsjmiW4C/zp8Cx0yCE= 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-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+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1765823456325383148?= X-GMAIL-MSGID: =?utf-8?q?1765823456325383148?= 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;