]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Do not use ENUM_BITFIELD
authorTom Tromey <tom@tromey.com>
Sun, 24 May 2026 17:35:50 +0000 (11:35 -0600)
committerTom Tromey <tom@tromey.com>
Fri, 29 May 2026 20:39:55 +0000 (14:39 -0600)
C++ always allows enum bitfields, so gdb no longer needs to use the
ENUM_BITFIELD macro.

Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=32821
Approved-By: Andrew Burgess <aburgess@redhat.com>
Reviewed-By: Guinevere Larsen <guinevere@redhat.com>
gdb/cli/cli-decode.h
gdb/dwarf2/abbrev.h
gdb/dwarf2/attribute.h
gdb/dwarf2/call-site.h
gdb/dwarf2/cooked-index-entry.h
gdb/dwarf2/die.h
gdb/frame-id.h
gdb/gdbtypes.h
gdb/macrotab.h
gdb/symtab.h
gdbsupport/packed.h

index 865f89ed9b5894f6da1d99c97e5f42f03a33ebdc..49384f4a04d0dd2b744eab116ef27d7cf81ae5e4 100644 (file)
@@ -177,7 +177,7 @@ struct cmd_list_element
 
   /* Type of "set" or "show" command (or SET_NOT_SET if not "set"
      or "show").  */
-  ENUM_BITFIELD (cmd_types) type : 2;
+  cmd_types type : 2;
 
   /* Function definition of this command.  NULL for command class
      names and for help topics that are not really commands.  NOTE:
index c5a3c6c39a625662b7c8563b4169736d2b6ef40c..78ad1e164ada9f47324f9d075ed902fd06a02445 100644 (file)
@@ -34,8 +34,8 @@
 
 struct attr_abbrev
 {
-  ENUM_BITFIELD(dwarf_attribute) name : 16;
-  ENUM_BITFIELD(dwarf_form) form : 16;
+  dwarf_attribute name : 16;
+  dwarf_form form : 16;
 
   /* It is valid only if FORM is DW_FORM_implicit_const.  */
   LONGEST implicit_const;
@@ -47,7 +47,7 @@ struct abbrev_info
   /* Number identifying abbrev.  */
   unsigned int number;
   /* DWARF tag.  */
-  ENUM_BITFIELD (dwarf_tag) tag : 16;
+  dwarf_tag tag : 16;
   /* True if the DIE has children.  */
   bool has_children;
   bool interesting;
index 776ce43825d42473c793bb13851bd91912589720..f2648747d9cf17d0b328e6243561059d139263fd 100644 (file)
@@ -338,7 +338,7 @@ struct attribute
      will issue a complaint and return false.  */
   bool as_boolean () const;
 
-  ENUM_BITFIELD(dwarf_attribute) name : 15;
+  dwarf_attribute name : 15;
 
   /* A boolean that is used for forms that require reprocessing.  A
      form may require data not directly available in the attribute.
@@ -351,7 +351,7 @@ struct attribute
      forms.  */
   unsigned int requires_reprocessing : 1;
 
-  ENUM_BITFIELD(dwarf_form) form : 15;
+  dwarf_form form : 15;
 
   /* Has u.str already been updated by dwarf2_canonicalize_name?  This
      field should be in u.str but it is kept here for better struct
index e55197213907f41f65f32ba4d9649420baee0461..5e2e270e3837b44a6044779359f92d23d41c306b 100644 (file)
@@ -152,7 +152,7 @@ struct call_site_parameter
   gdb::array_view<const gdb_byte> data_value_expr () const
   { return gdb::make_array_view (data_value, data_value_size); }
 
-  ENUM_BITFIELD (call_site_parameter_kind) kind : 2;
+  call_site_parameter_kind kind : 2;
 
   union call_site_parameter_u u;
 
index 9f7a7c42de4f67c532aaec16feebad46ba923472..60ea581cbbe58e60faa4f095272c42af2cc6021f 100644 (file)
@@ -267,7 +267,7 @@ struct cooked_index_entry : public allocate_on_obstack<cooked_index_entry>
      situation where the language is initially unknown, and then only
      filled in later.  In particular this can happen when using
      .gdb_index.  See also cooked_index_functions::search.  */
-  mutable ENUM_BITFIELD (language) lang : LANGUAGE_BITS;
+  mutable language lang : LANGUAGE_BITS;
   /* The offset of this DIE.  */
   sect_offset die_offset;
   /* The CU from which this entry originates.  This may point to a
index c5f8a8e89f1930ddd794ecd6761f2b4a7c216b2a..a8bc147b1c8c74d17966e5b86f2b58b0fb8c23ce 100644 (file)
@@ -114,7 +114,7 @@ struct die_info
   }
 
   /* DWARF-2 tag for this DIE.  */
-  ENUM_BITFIELD(dwarf_tag) tag : 16;
+  dwarf_tag tag : 16;
 
   /* Number of attributes */
   unsigned char num_attrs;
index 50de31133a642078df78c1a878f549d7089ae1bc..677b159b26beac3074b38225102bb21e431115ed 100644 (file)
@@ -95,7 +95,7 @@ struct frame_id
   CORE_ADDR special_addr;
 
   /* Flags to indicate the above fields have valid contents.  */
-  ENUM_BITFIELD(frame_id_stack_status) stack_status : 3;
+  frame_id_stack_status stack_status : 3;
   unsigned int code_addr_p : 1;
   unsigned int special_addr_p : 1;
 
index b32056ce530c0721b0d1fd2b80887acfeb9df27b..027b814fe6a8e6dd02a3482178abb9d30318b8c0 100644 (file)
@@ -756,7 +756,7 @@ struct field
 
   /* * Discriminant for union field_location.  */
 
-  ENUM_BITFIELD(field_loc_kind) m_loc_kind : 3;
+  field_loc_kind m_loc_kind : 3;
 
   /* Accessibility of the field.  */
   enum accessibility m_accessibility;
@@ -902,7 +902,7 @@ struct main_type
 {
   /* * Code for kind of type.  */
 
-  ENUM_BITFIELD(type_code) code : 8;
+  type_code code : 8;
 
   /* * Flags about this type.  These fields appear at this location
      because they packs nicely here.  See the TYPE_* macros for
@@ -942,11 +942,11 @@ struct main_type
   /* * A discriminant telling us which field of the type_specific
      union is being used for this type, if any.  */
 
-  ENUM_BITFIELD(type_specific_kind) type_specific_field : 3;
+  type_specific_kind type_specific_field : 3;
 
   /* The language for this type.  */
 
-  ENUM_BITFIELD(language) m_lang : LANGUAGE_BITS;
+  language m_lang : LANGUAGE_BITS;
 
   /* * Number of fields described for this type.  This field appears
      at this location because it packs nicely here.  */
@@ -1667,7 +1667,7 @@ struct fn_field
   /* * DW_AT_defaulted attribute for this function.  The value is one
      of the DW_DEFAULTED constants.  */
 
-  ENUM_BITFIELD (dwarf_defaulted_attribute) defaulted : 2;
+  dwarf_defaulted_attribute defaulted : 2;
 
   /* Accessibility of the field.  */
   enum accessibility accessibility;
@@ -1745,7 +1745,7 @@ struct cplus_struct_type
        DW_AT_calling_convention attribute.  The value is one of the
        DW_CC constants.  */
 
-    ENUM_BITFIELD (dwarf_calling_convention) calling_convention : 8;
+    dwarf_calling_convention calling_convention : 8;
 
     /* * The base class which defined the virtual function table pointer.  */
 
@@ -1821,7 +1821,7 @@ struct func_type
        DW_AT_calling_convention attribute.  The value is one of the
        DW_CC constants.  */
 
-    ENUM_BITFIELD (dwarf_calling_convention) calling_convention : 8;
+    dwarf_calling_convention calling_convention : 8;
 
     /* * Whether this function normally returns to its caller.  It is
        set from the DW_AT_noreturn attribute if set on the
index 4e66c7ac9157adae15a5236450e8d6da071ac06e..1a4c46a1cb1b90f6d489456e1d99a1b93209ebc9 100644 (file)
@@ -291,7 +291,7 @@ struct macro_definition
   struct macro_table *table;
 
   /* What kind of macro it is.  */
-  ENUM_BITFIELD (macro_kind) kind : 1;
+  macro_kind kind : 1;
 
   /* If `kind' is `macro_function_like', the number of arguments it
      takes, and their names.  The names, and the array of pointers to
index 5a3db47d84fd895d54ffb2127c56d53528e78ef3..0a7ad3668b46c4757930af7e91571224f41e41da 100644 (file)
@@ -404,11 +404,11 @@ typedef bool (symbol_name_matcher_ftype)
      struct partial_symbol
 
    These structures are laid out to encourage good packing.
-   They use ENUM_BITFIELD and short int fields, and they order the
+   They use bitfields and short int fields, and they order the
    structure members so that fields less than a word are next
    to each other so they can be packed together.  */
 
-/* Rearranged: used ENUM_BITFIELD and rearranged field order in
+/* Rearranged: used bitfields and rearranged field order in
    all the space critical structures (plus struct minimal_symbol).
    Memory usage dropped from 99360768 bytes to 90001408 bytes.
    I measured this with before-and-after tests of
@@ -586,7 +586,7 @@ struct general_symbol_info
      This is used to select one of the fields from the language specific
      union above.  */
 
-  ENUM_BITFIELD(language) m_language : LANGUAGE_BITS;
+  enum language m_language : LANGUAGE_BITS;
 
   /* This is only used by Ada.  If set, then the 'demangled_name' field
      of language_specific is valid.  Otherwise, the 'obstack' field is
@@ -815,7 +815,7 @@ struct minimal_symbol : public general_symbol_info
 
   /* Classification type for this minimal symbol.  */
 
-  ENUM_BITFIELD(minimal_symbol_type) m_type : MINSYM_TYPE_BITS;
+  minimal_symbol_type m_type : MINSYM_TYPE_BITS;
 
   /* Non-zero if this symbol was created by gdb.
      Such symbols do not appear in the output of "info var|fun".  */
@@ -1468,7 +1468,7 @@ struct symbol : public general_symbol_info, public allocate_on_obstack<symbol>
 
   /* Domain code.  */
 
-  ENUM_BITFIELD(domain_enum) m_domain : SYMBOL_DOMAIN_BITS;
+  domain_enum m_domain : SYMBOL_DOMAIN_BITS;
 
   /* Location class.  This holds an index into the 'symbol_impls'
      table.  The actual location_class value is stored there,
@@ -1498,7 +1498,7 @@ struct symbol : public general_symbol_info, public allocate_on_obstack<symbol>
 
   /* The concrete type of this symbol.  */
 
-  ENUM_BITFIELD (symbol_subclass_kind) subclass : 2;
+  symbol_subclass_kind subclass : 2;
 
   /* Whether this symbol is artificial.  */
 
index 16564d5312e70230f70e1d12297971e71f09df8d..70ffb712e192ebf09f02d30dfd24278c6978a116 100644 (file)
@@ -25,8 +25,8 @@
    defines a type that behaves like a given scalar type, but that has
    byte alignment, and, may optionally have a smaller size than the
    given scalar type.  This is typically used as alternative to
-   bit-fields (and ENUM_BITFIELD), when the fields must have separate
-   memory locations to avoid data races.  */
+   bit-fields, when the fields must have separate memory locations to
+   avoid data races.  */
 
 /* There are two implementations here -- one standard compliant, using
    a byte array for internal representation, and another that relies