public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] rtl: Forward declare rtx_code
@ 2023-08-22 12:02 Richard Earnshaw
  2023-08-23 15:49 ` Richard Sandiford
  0 siblings, 1 reply; 4+ messages in thread
From: Richard Earnshaw @ 2023-08-22 12:02 UTC (permalink / raw)
  To: gcc-patches; +Cc: Richard Earnshaw

[-- Attachment #1: Type: text/plain, Size: 341 bytes --]


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(-)


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-rtl-Forward-declare-rtx_code.patch --]
[-- Type: text/x-patch; name="0001-rtl-Forward-declare-rtx_code.patch", Size: 930 bytes --]

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 */

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-08-23 16:18 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-08-22 12:02 [PATCH] rtl: Forward declare rtx_code Richard Earnshaw
2023-08-23 15:49 ` Richard Sandiford
2023-08-23 16:11   ` Richard Earnshaw (lists)
2023-08-23 16:18     ` Richard Sandiford

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).