diff options
author | Tom Tromey <tom@tromey.com> | 2021-06-25 12:23:04 -0600 |
---|---|---|
committer | Tom Tromey <tom@tromey.com> | 2021-06-25 12:23:04 -0600 |
commit | bf1dcdb3910e003c29c278ddb48eb56cfd045138 (patch) | |
tree | 62737349a9aa423cc10b9627593ad0b1a765778b /gdb/dwarf2/cu.h | |
parent | 6b95f5ad9684530960eb828c76755a7b27a44e43 (diff) | |
download | gdb-bf1dcdb3910e003c29c278ddb48eb56cfd045138.zip gdb-bf1dcdb3910e003c29c278ddb48eb56cfd045138.tar.gz gdb-bf1dcdb3910e003c29c278ddb48eb56cfd045138.tar.bz2 |
Consolidate CU language setting
The DWARF reader currently sets the CU's language in two different
spots. It is primarily done in prepare_one_comp_unit, but
read_file_scope also checks the producer and may change the language
based on the result.
This patch consolidates all language-setting into
prepare_one_comp_unit. set_cu_language is renamed and changed not to
set language_defn; instead that is done in prepare_one_comp_unit after
the correct language enum value is chosen.
This fixes a minor latent bug, which is that read_file_scope could set
the language enum value to language_opencl, but then neglected to
reset language_defn in this case.
gdb/ChangeLog
2021-06-25 Tom Tromey <tom@tromey.com>
* dwarf2/read.c (read_file_scope): Don't call set_cu_language.
(dwarf_lang_to_enum_language): Rename from set_cu_language. Don't
set language_defn. Handle DW_LANG_OpenCL.
(prepare_one_comp_unit): Check producer and set language_defn.
Diffstat (limited to 'gdb/dwarf2/cu.h')
0 files changed, 0 insertions, 0 deletions