]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
rtl: Forward declare rtx_code
authorRichard Earnshaw <rearnsha@arm.com>
Thu, 27 Jul 2023 16:28:30 +0000 (17:28 +0100)
committerRichard Earnshaw <rearnsha@arm.com>
Wed, 23 Aug 2023 16:13:29 +0000 (17:13 +0100)
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
gcc/rtl.h

index 3e9a2f19e27b8e4096db9e8033624596abb5044d..f86dc169a40b069b68efdfe8885566917e914a7d 100644 (file)
@@ -101,6 +101,10 @@ typedef gimple *gimple_seq;
 struct gimple_stmt_iterator;
 class code_helper;
 
+/* 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.  */
 
index e1c51156f90964252f1ef397b3e53b36ac3a4b42..0e9491b89b4d619a6b18100971f8f3007bb98b09 100644 (file)
--- 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 */