From patchwork Tue Aug 22 12:02:19 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Earnshaw X-Patchwork-Id: 136532 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b82d:0:b0:3f2:4152:657d with SMTP id z13csp3573789vqi; Tue, 22 Aug 2023 05:03:34 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFJM/jEA0oKumMn1tHyGI6wjZQKcBtbUsCKA8cJfCRPsg4wRCrHnfHavGWb5pd9rIVSTFL3 X-Received: by 2002:a17:906:220f:b0:991:e7c2:d0be with SMTP id s15-20020a170906220f00b00991e7c2d0bemr8459066ejs.63.1692705813731; Tue, 22 Aug 2023 05:03:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1692705813; cv=none; d=google.com; s=arc-20160816; b=UdDahDVPAoCP0IQta2ud1KnAVQfbq9ORMgSugRjhCvs6FcsJ6nF2paBDk3g93RRlFc 46ZM57XLou9eZq5h4w/UWmuA79yHjw5IoS59VaF5DtRP7Q4m0LdvSOZ+hls0czoV5M+G FsCBVt33bE4kN6GAcGtese3x2W8LGxVCPHe4Sggxbpt90ixknI5wa0zUSmxux0v9nRS/ JavZBkuFn/WQzSnFqA1xHElqwQwtDgqd3u8DE6/K8x74hOPnSUAPPPzKFvTtb9fyQOwF o0JlWR+oucwXeGmZjPBt0nUkbQpLdRsZdcNgpr3QYtgxne3hSGTbsaVE6iaobc+zkOzd HTGQ== 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:message-id:date:subject:cc :to:dmarc-filter:delivered-to:dkim-signature:dkim-filter; bh=OHTUsSzS2J86+8xOHkU/wVksFU4jo34pEHBd6MeikEw=; fh=nfyD1w0e7aXAAOiCxVzdBNBJTcEgIcyvjROCQx1VeVM=; b=imzhQnCXDBmFn6lmrX/EjI+E+HhSV4muQhk0e5ibhHk8WQS8RTTjTj1uYLPOf68X6U +RG7WKo7y3jJ3iiG2hmOBz4OleI5rQS3xm9lrpRKfmwGuNdMgbGrr2COSNXhCBDaEZB+ XmKBdw3DG0QaYJ60cG//oJDBDKnuju0C6R2TILkr/YsEkPqhE9fWprSUfaAeatnnvOeD vH5JL6Mlliy5Ly1PlTa+hZ83eJNr5JmL51Qq0doWvqpA2FOFplEM9VBxCGQRgHLcQNpa lhhD74iYMKpjs3k1Hp7CkKvo6vkOL2n/6higFmmGgPc2OG9UdUeY1O4IFXYT7UN7AniP SvnQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b="mx8avYT/"; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c 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 (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id u7-20020a17090626c700b00988565fbf63si7531786ejc.437.2023.08.22.05.03.33 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 22 Aug 2023 05:03:33 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b="mx8avYT/"; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c 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 C3DE3385C6E4 for ; Tue, 22 Aug 2023 12:03:30 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C3DE3385C6E4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1692705810; bh=OHTUsSzS2J86+8xOHkU/wVksFU4jo34pEHBd6MeikEw=; h=To:Cc:Subject:Date:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From:Reply-To:From; b=mx8avYT/uU0mhm37iVN9X5fyksq7tk6tCVu53sfX+UwCjb9nvKWOqGuB3z5TEKj8o 3nSts/RvUXb2wgV9UqY4A11DgOIyrCKLQYonn9dT88io2MIX8ypMcJ9p2wU6CFzOWC p+cyre+ZUTrrqKp4pOHQ3bc6YYAe/L9j8/jSYz5U= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by sourceware.org (Postfix) with ESMTP id B27043858C60 for ; Tue, 22 Aug 2023 12:02:39 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org B27043858C60 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 168B811FB; Tue, 22 Aug 2023 05:03:20 -0700 (PDT) Received: from e120077-lin.cambridge.arm.com (e120077-lin.cambridge.arm.com [10.2.78.54]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id AF4293F740; Tue, 22 Aug 2023 05:02:38 -0700 (PDT) To: gcc-patches@gcc.gnu.org Cc: Richard Earnshaw Subject: [PATCH] rtl: Forward declare rtx_code Date: Tue, 22 Aug 2023 13:02:19 +0100 Message-Id: <20230822120219.3997652-1-rearnsha@arm.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-Spam-Status: No, score=-15.3 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_NONE, KAM_DMARC_STATUS, KAM_LAZY_DOMAIN_SECURITY, SPF_HELO_NONE, SPF_NONE, TXREP 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: Richard Earnshaw via Gcc-patches From: Richard Earnshaw Reply-To: Richard Earnshaw Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1774930691502895854 X-GMAIL-MSGID: 1774930691502895854 Now that we require C++ 11, we can safely forward declare rtx_code so that we can use it in target hooks. gcc/ChangeLog * coretypes.h (rtx_code): Add forward declaration. * rtl.h (rtx_code): Make compatible with forward declaration. --- gcc/coretypes.h | 4 ++++ gcc/rtl.h | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/gcc/coretypes.h b/gcc/coretypes.h index ca8837cef67..51e55559ce0 100644 --- a/gcc/coretypes.h +++ b/gcc/coretypes.h @@ -100,6 +100,10 @@ struct gimple; typedef gimple *gimple_seq; struct gimple_stmt_iterator; +/* Forward declare rtx_code, so that we can use it in target hooks without + needing to pull in rtl.h. */ +enum rtx_code : unsigned; + /* Forward decls for leaf gimple subclasses (for individual gimple codes). Keep this in the same order as the corresponding codes in gimple.def. */ diff --git a/gcc/rtl.h b/gcc/rtl.h index e1c51156f90..0e9491b89b4 100644 --- a/gcc/rtl.h +++ b/gcc/rtl.h @@ -45,7 +45,7 @@ class predefined_function_abi; /* Register Transfer Language EXPRESSIONS CODES */ #define RTX_CODE enum rtx_code -enum rtx_code { +enum rtx_code : unsigned { #define DEF_RTL_EXPR(ENUM, NAME, FORMAT, CLASS) ENUM , #include "rtl.def" /* rtl expressions are documented here */