Remove dwarf2_cu::language
authorTom Tromey <tom@tromey.com>
Fri, 25 Jun 2021 18:23:04 +0000 (12:23 -0600)
committerTom Tromey <tom@tromey.com>
Fri, 25 Jun 2021 18:23:05 +0000 (12:23 -0600)
commit3e9f1ca148ca2ecf6cd008ed2678a4cbe253620b
tree07ec34c8c35c5db55e6d2f15329c71311b2e296d
parentbf1dcdb3910e003c29c278ddb48eb56cfd045138
Remove dwarf2_cu::language

dwarf2_cu has a 'language' value, but dwarf2_per_cu_data also holds a
value of this same type.  There doesn't seem to be any reason to keep
two copies of this value.  This patch removes the field from
dwarf2_cu, and arranges to set the value in the per-CU object instead.

Note that the value must still be set when expanding the full CU.
This is needed because the CUs will not be scanned when a DWARF index
is in use.

gdb/ChangeLog
2021-06-25  Tom Tromey  <tom@tromey.com>

* dwarf2/read.c (process_psymtab_comp_unit): Don't set 'lang'.
(scan_partial_symbols, partial_die_parent_scope)
(add_partial_symbol, add_partial_subprogram)
(compute_delayed_physnames, rust_union_quirks)
(process_full_comp_unit, process_full_type_unit)
(process_imported_unit_die, process_die, dw2_linkage_name)
(dwarf2_compute_name, dwarf2_physname, read_import_statement)
(read_file_scope, queue_and_load_dwo_tu, read_func_scope)
(read_variable, dwarf2_get_subprogram_pc_bounds)
(dwarf2_attach_fields_to_type, dwarf2_add_member_fn)
(dwarf2_attach_fn_fields_to_type)
(quirk_ada_thick_pointer_struct, read_structure_type)
(handle_struct_member_die, process_structure_scope)
(read_array_type, read_array_order, prototyped_function_p)
(read_subroutine_type, dwarf2_init_complex_target_type)
(read_base_type, read_subrange_type, read_unspecified_type)
(load_partial_dies, partial_die_info::fixup, set_cu_language)
(new_symbol, need_gnat_info, determine_prefix, typename_concat)
(dwarf2_canonicalize_name, follow_die_offset)
(prepare_one_comp_unit): Update.
* dwarf2/cu.c (dwarf2_cu::start_symtab): Update.
gdb/ChangeLog
gdb/dwarf2/cu.c
gdb/dwarf2/cu.h
gdb/dwarf2/read.c