diff options
author | Tom Tromey <tom@tromey.com> | 2023-10-15 11:09:07 -0600 |
---|---|---|
committer | Tom Tromey <tom@tromey.com> | 2023-11-29 14:29:43 -0700 |
commit | d182e39881061b11d1eb85426d9a6953e3171bf5 (patch) | |
tree | c292f0615eee648207c86ae7035479cb518ea81a /gdb/dwarf2 | |
parent | a0dc1f9a12a4394463b9dbf5927166f2ab8518a6 (diff) | |
download | gdb-d182e39881061b11d1eb85426d9a6953e3171bf5.zip gdb-d182e39881061b11d1eb85426d9a6953e3171bf5.tar.gz gdb-d182e39881061b11d1eb85426d9a6953e3171bf5.tar.bz2 |
Use C++17 [[fallthrough]] attribute
This changes gdb to use the C++17 [[fallthrough]] attribute rather
than special comments.
This was mostly done by script, but I neglected a few spellings and so
also fixed it up by hand.
I suspect this fixes the bug mentioned below, by switching to a
standard approach that, presumably, clang supports.
Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=23159
Approved-By: John Baldwin <jhb@FreeBSD.org>
Approved-By: Luis Machado <luis.machado@arm.com>
Approved-By: Pedro Alves <pedro@palves.net>
Diffstat (limited to 'gdb/dwarf2')
-rw-r--r-- | gdb/dwarf2/macro.c | 4 | ||||
-rw-r--r-- | gdb/dwarf2/read.c | 22 |
2 files changed, 13 insertions, 13 deletions
diff --git a/gdb/dwarf2/macro.c b/gdb/dwarf2/macro.c index 2e88e67..7d86d16 100644 --- a/gdb/dwarf2/macro.c +++ b/gdb/dwarf2/macro.c @@ -784,7 +784,7 @@ dwarf_decode_macro_bytes (dwarf2_per_objfile *per_objfile, /* We don't recognize any vendor extensions. */ break; } - /* FALLTHROUGH */ + [[fallthrough]]; default: mac_ptr = skip_unknown_opcode (macinfo_type, opcode_definitions, @@ -939,7 +939,7 @@ dwarf_decode_macros (dwarf2_per_objfile *per_objfile, read_direct_string (abfd, mac_ptr, &bytes_read); mac_ptr += bytes_read; } - /* FALLTHROUGH */ + [[fallthrough]]; default: mac_ptr = skip_unknown_opcode (macinfo_type, opcode_definitions, diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c index 9f3297a..468e76d 100644 --- a/gdb/dwarf2/read.c +++ b/gdb/dwarf2/read.c @@ -6489,7 +6489,7 @@ process_die (struct die_info *die, struct dwarf2_cu *cu) && die->parent != NULL && die->parent->tag == DW_TAG_subprogram) cu->processing_has_namespace_info = true; - /* Fall through. */ + [[fallthrough]]; case DW_TAG_inlined_subroutine: read_func_scope (die, cu); break; @@ -6531,7 +6531,7 @@ process_die (struct die_info *die, struct dwarf2_cu *cu) instead. */ if (cu->lang () != language_ada) break; - /* FALLTHROUGH */ + [[fallthrough]]; case DW_TAG_base_type: case DW_TAG_subrange_type: case DW_TAG_generic_subrange: @@ -6559,7 +6559,7 @@ process_die (struct die_info *die, struct dwarf2_cu *cu) break; /* The declaration is neither a global namespace nor a variable alias. */ - /* Fall through. */ + [[fallthrough]]; case DW_TAG_imported_module: cu->processing_has_namespace_info = true; if (die->child != NULL && (die->tag == DW_TAG_imported_declaration @@ -16433,7 +16433,7 @@ cooked_indexer::index_dies (cutu_reader *reader, case DW_TAG_module: if (this_entry == nullptr) break; - /* FALLTHROUGH */ + [[fallthrough]]; case DW_TAG_namespace: /* We don't check THIS_ENTRY for a namespace, to handle the ancient G++ workaround pointed out above. */ @@ -17140,7 +17140,7 @@ read_attribute_value (const struct die_reader_specs *reader, info_ptr += bytes_read; break; } - /* FALLTHROUGH */ + [[fallthrough]]; case DW_FORM_line_strp: if (!cu->per_cu->is_dwz) { @@ -17150,7 +17150,7 @@ read_attribute_value (const struct die_reader_specs *reader, info_ptr += bytes_read; break; } - /* FALLTHROUGH */ + [[fallthrough]]; case DW_FORM_GNU_strp_alt: { dwz_file *dwz = dwarf2_get_dwz_file (per_objfile->per_bfd, true); @@ -18963,7 +18963,7 @@ new_symbol (struct die_info *die, struct type *type, struct dwarf2_cu *cu, break; case DW_TAG_template_value_param: suppress_add = 1; - /* Fall through. */ + [[fallthrough]]; case DW_TAG_constant: case DW_TAG_variable: case DW_TAG_member: @@ -19140,7 +19140,7 @@ new_symbol (struct die_info *die, struct type *type, struct dwarf2_cu *cu, break; case DW_TAG_template_type_param: suppress_add = 1; - /* Fall through. */ + [[fallthrough]]; case DW_TAG_class_type: case DW_TAG_interface_type: case DW_TAG_structure_type: @@ -19194,7 +19194,7 @@ new_symbol (struct die_info *die, struct type *type, struct dwarf2_cu *cu, case DW_TAG_unspecified_type: if (cu->lang () == language_ada) break; - /* FALLTHROUGH */ + [[fallthrough]]; case DW_TAG_typedef: case DW_TAG_array_type: case DW_TAG_base_type: @@ -19990,7 +19990,7 @@ determine_prefix (struct die_info *die, struct dwarf2_cu *cu) return parent_type->name (); return ""; } - /* Fall through. */ + [[fallthrough]]; default: return determine_prefix (parent, cu); } @@ -20174,7 +20174,7 @@ dwarf2_name (struct die_info *die, struct dwarf2_cu *cu) case DW_TAG_template_value_param: if (attr_name == nullptr) return unnamed_template_tag_name (die, cu); - /* FALLTHROUGH. */ + [[fallthrough]]; case DW_TAG_class_type: case DW_TAG_interface_type: case DW_TAG_structure_type: |