c++: Remove some gratuitous typedefing
authorNathan Sidwell <nathan@acm.org>
Wed, 23 Sep 2020 15:13:25 +0000 (08:13 -0700)
committerNathan Sidwell <nathan@acm.org>
Wed, 23 Sep 2020 15:15:40 +0000 (08:15 -0700)
This is C++, we don't need 'typedef struct foo foo;'. Oh, and bool
bitfields are a thing.

gcc/cp/
* name-lookup.h (typedef cxx_binding): Delete tdef.
(typedef cp_binding_level): Likewise.
(struct cxx_binding): Flags are bools.

gcc/cp/name-lookup.h

index a0815e1..5d2d364 100644 (file)
@@ -47,12 +47,8 @@ struct GTY(()) binding_entry_s {
 extern void binding_table_foreach (binding_table, bt_foreach_proc, void *);
 extern binding_entry binding_table_find (binding_table, tree);
 \f
-/* Datatype that represents binding established by a declaration between
-   a name and a C++ entity.  */
-typedef struct cxx_binding cxx_binding;
-
 /* The datatype used to implement C++ scope.  */
-typedef struct cp_binding_level cp_binding_level;
+struct cp_binding_level;
 
 /* Nonzero if this binding is for a local scope, as opposed to a class
    or namespace scope.  */
@@ -62,6 +58,8 @@ typedef struct cp_binding_level cp_binding_level;
    currently being defined.  */
 #define INHERITED_VALUE_BINDING_P(NODE) ((NODE)->value_is_inherited)
 
+/* Datatype that represents binding established by a declaration between
+   a name and a C++ entity.  */
 struct GTY(()) cxx_binding {
   /* Link to chain together various bindings for this name.  */
   cxx_binding *previous;
@@ -71,8 +69,9 @@ struct GTY(()) cxx_binding {
   tree type;
   /* The scope at which this binding was made.  */
   cp_binding_level *scope;
-  unsigned value_is_inherited : 1;
-  unsigned is_local : 1;
+
+  bool value_is_inherited : 1;
+  bool is_local : 1;
 };
 
 /* Datatype used to temporarily save C++ bindings (for implicit