]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Remove extraneous blocks from dwarf2/read.c:new_symbol
authorTom Tromey <tom@tromey.com>
Fri, 17 Nov 2023 18:04:08 +0000 (11:04 -0700)
committerTom Tromey <tom@tromey.com>
Fri, 17 Nov 2023 18:06:34 +0000 (11:06 -0700)
dwarf2/read.c:new_symbol has some extra braces in a couple of 'case's.
These read weirdly to me, and since they aren't necessary, this patch
removes the braces and reindents the bodies.  Tested by rebuilding.

gdb/dwarf2/read.c

index 7a3b9c68279262732e5d44662c2c44c891816d50..e8ff4d8f29a4cfebe5d53334c1f1336661b26760 100644 (file)
@@ -19212,39 +19212,38 @@ new_symbol (struct die_info *die, struct type *type, struct dwarf2_cu *cu,
              sym->set_aclass_index (LOC_TYPEDEF);
              sym->set_domain (STRUCT_DOMAIN);
            }
-         {
-           /* NOTE: carlton/2003-11-10: C++ class symbols shouldn't
-              really ever be static objects: otherwise, if you try
-              to, say, break of a class's method and you're in a file
-              which doesn't mention that class, it won't work unless
-              the check for all static symbols in lookup_symbol_aux
-              saves you.  See the OtherFileClass tests in
-              gdb.c++/namespace.exp.  */
-
-           if (!suppress_add)
-             {
-               buildsym_compunit *builder = cu->get_builder ();
-               list_to_add
-                 = (cu->list_in_scope == builder->get_file_symbols ()
-                    && cu->lang () == language_cplus
-                    ? builder->get_global_symbols ()
-                    : cu->list_in_scope);
-
-               /* The semantics of C++ state that "struct foo {
-                  ... }" also defines a typedef for "foo".  */
-               if (cu->lang () == language_cplus
-                   || cu->lang () == language_ada
-                   || cu->lang () == language_d
-                   || cu->lang () == language_rust)
-                 {
-                   /* The symbol's name is already allocated along
-                      with this objfile, so we don't need to
-                      duplicate it for the type.  */
-                   if (sym->type ()->name () == 0)
-                     sym->type ()->set_name (sym->search_name ());
-                 }
-             }
-         }
+
+         /* NOTE: carlton/2003-11-10: C++ class symbols shouldn't
+            really ever be static objects: otherwise, if you try
+            to, say, break of a class's method and you're in a file
+            which doesn't mention that class, it won't work unless
+            the check for all static symbols in lookup_symbol_aux
+            saves you.  See the OtherFileClass tests in
+            gdb.c++/namespace.exp.  */
+
+         if (!suppress_add)
+           {
+             buildsym_compunit *builder = cu->get_builder ();
+             list_to_add
+               = (cu->list_in_scope == builder->get_file_symbols ()
+                  && cu->lang () == language_cplus
+                  ? builder->get_global_symbols ()
+                  : cu->list_in_scope);
+
+             /* The semantics of C++ state that "struct foo {
+                ... }" also defines a typedef for "foo".  */
+             if (cu->lang () == language_cplus
+                 || cu->lang () == language_ada
+                 || cu->lang () == language_d
+                 || cu->lang () == language_rust)
+               {
+                 /* The symbol's name is already allocated along
+                    with this objfile, so we don't need to
+                    duplicate it for the type.  */
+                 if (sym->type ()->name () == 0)
+                   sym->type ()->set_name (sym->search_name ());
+               }
+           }
          break;
        case DW_TAG_unspecified_type:
          if (cu->lang () == language_ada)
@@ -19265,16 +19264,15 @@ new_symbol (struct die_info *die, struct type *type, struct dwarf2_cu *cu,
            {
              dwarf2_const_value (attr, sym, cu);
            }
-         {
-           /* NOTE: carlton/2003-11-10: See comment above in the
-              DW_TAG_class_type, etc. block.  */
-
-           list_to_add
-             = (cu->list_in_scope == cu->get_builder ()->get_file_symbols ()
-                && cu->lang () == language_cplus
-                ? cu->get_builder ()->get_global_symbols ()
-                : cu->list_in_scope);
-         }
+
+         /* NOTE: carlton/2003-11-10: See comment above in the
+            DW_TAG_class_type, etc. block.  */
+
+         list_to_add
+           = (cu->list_in_scope == cu->get_builder ()->get_file_symbols ()
+              && cu->lang () == language_cplus
+              ? cu->get_builder ()->get_global_symbols ()
+              : cu->list_in_scope);
          break;
        case DW_TAG_imported_declaration:
        case DW_TAG_namespace: