]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
tree-core: Remove ENUM_BITFIELD from tree-core.h [PR125507]
authorAndrew Pinski <andrew.pinski@oss.qualcomm.com>
Tue, 2 Jun 2026 20:05:06 +0000 (13:05 -0700)
committerAndrew Pinski <andrew.pinski@oss.qualcomm.com>
Wed, 3 Jun 2026 04:20:37 +0000 (21:20 -0700)
This removes ENUM_BITFIELD from tree-core.h. GCC has been written in C++ for
years now. So enums can be bitfields. There is no reason for the macro.
This removes the macro usage from tree-core.h. The other uses can be removed
by others.

Note gengtype needed to support for tree_code to remove the extra enum that is added
for other others.

Bootstrapped and tested on x86_64-linux-gnu.

PR middle-end/125507

gcc/ChangeLog:

* gengtype.cc (main): Add tree_code.
* tree-core.h (struct tree_base): Remove ENUM_BITFIELD.
(struct tree_type_common): Likewise.
(struct tree_decl_common): Likewise.
(struct tree_decl_with_vis): Likewise.
(struct tree_function_decl): Likewise.

Signed-off-by: Andrew Pinski <andrew.pinski@oss.qualcomm.com>
gcc/gengtype.cc
gcc/tree-core.h

index 061162393447c23c762cf7bc014dbe35a0ead157..a348106d532fd1e78e272265cb93571e32198b34 100644 (file)
@@ -5257,6 +5257,7 @@ main (int argc, char **argv)
       POS_HERE (do_scalar_typedef ("JCF_u2", &pos));
       POS_HERE (do_scalar_typedef ("void", &pos));
       POS_HERE (do_scalar_typedef ("machine_mode", &pos));
+      POS_HERE (do_scalar_typedef ("tree_code", &pos));
       POS_HERE (do_scalar_typedef ("fixed_size_mode", &pos));
       POS_HERE (do_scalar_typedef ("CONSTEXPR", &pos));
       POS_HERE (do_typedef ("void *",
index a70e60e32900489f43487b4b0d4fd112382aadc4..09c07c5c1297cce8805a31158064eeb4352863ad 100644 (file)
@@ -1136,7 +1136,7 @@ typedef tree (*walk_tree_lh) (tree *, int *, tree (*) (tree *, int *, void *),
    accessor macros.  */
 
 struct GTY(()) tree_base {
-  ENUM_BITFIELD(tree_code) code : 16;
+  tree_code code : 16;
 
   unsigned side_effects_flag : 1;
   unsigned constant_flag : 1;
@@ -1805,7 +1805,7 @@ struct GTY(()) tree_type_common {
   tree attributes;
   unsigned int uid;
 
-  ENUM_BITFIELD(machine_mode) mode : MACHINE_MODE_BITSIZE;
+  machine_mode mode : MACHINE_MODE_BITSIZE;
 
   unsigned int precision : 16;
   unsigned lang_flag_0 : 1;
@@ -1898,7 +1898,7 @@ struct GTY(()) tree_decl_common {
   struct tree_decl_minimal common;
   tree size;
 
-  ENUM_BITFIELD(machine_mode) mode : MACHINE_MODE_BITSIZE;
+  machine_mode mode : MACHINE_MODE_BITSIZE;
 
   unsigned nonlocal_flag : 1;
   unsigned virtual_flag : 1;
@@ -2023,7 +2023,7 @@ struct GTY(()) tree_decl_with_vis {
  unsigned seen_in_bind_expr : 1;
  unsigned comdat_flag : 1;
  /* Used for FUNCTION_DECL, VAR_DECL and in C++ for TYPE_DECL.  */
ENUM_BITFIELD(symbol_visibility) visibility : 2;
enum symbol_visibility visibility : 2;
  unsigned visibility_specified : 1;
 
  /* Belong to FUNCTION_DECL exclusively.  */
@@ -2091,7 +2091,7 @@ struct GTY(()) tree_function_decl {
   /* In a FUNCTION_DECL this is DECL_UNCHECKED_FUNCTION_CODE.  */
   unsigned int function_code;
 
-  ENUM_BITFIELD(built_in_class) built_in_class : 2;
+  enum built_in_class built_in_class : 2;
   unsigned static_ctor_flag : 1;
   unsigned static_dtor_flag : 1;
   unsigned uninlinable : 1;
@@ -2109,7 +2109,7 @@ struct GTY(()) tree_function_decl {
   unsigned looping_const_or_pure_flag : 1;
 
   /* Align the bitfield to boundary of a byte.  */
-  ENUM_BITFIELD(function_decl_type) decl_type: 2;
+  enum function_decl_type decl_type: 2;
   unsigned has_debug_args_flag : 1;
   unsigned versioned_function : 1;
   unsigned replaceable_operator : 1;