aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Earnshaw <rearnsha@arm.com>2023-07-27 17:28:30 +0100
committerRichard Earnshaw <rearnsha@arm.com>2023-08-23 17:13:29 +0100
commit3e086a12c273e5abb45d0228dc624acf97871ef3 (patch)
tree19d2da076ff418dcd0e0b59bf5244a819f0d11b0
parent94a25d3dede035ce8318ae25388d658753c90a3b (diff)
downloadgcc-3e086a12c273e5abb45d0228dc624acf97871ef3.zip
gcc-3e086a12c273e5abb45d0228dc624acf97871ef3.tar.gz
gcc-3e086a12c273e5abb45d0228dc624acf97871ef3.tar.bz2
rtl: Forward declare rtx_code
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.
-rw-r--r--gcc/coretypes.h4
-rw-r--r--gcc/rtl.h2
2 files changed, 5 insertions, 1 deletions
diff --git a/gcc/coretypes.h b/gcc/coretypes.h
index 3e9a2f1..f86dc16 100644
--- a/gcc/coretypes.h
+++ b/gcc/coretypes.h
@@ -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. */
diff --git a/gcc/rtl.h b/gcc/rtl.h
index e1c5115..0e9491b 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 */