]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
Move int type methods out of dwarf2_per_cu_data
authorSimon Marchi <simon.marchi@efficios.com>
Wed, 26 Feb 2020 04:25:19 +0000 (23:25 -0500)
committerSimon Marchi <simon.marchi@efficios.com>
Tue, 12 May 2020 19:24:50 +0000 (15:24 -0400)
commitd2634098f393309c19c438aac68b93c10a3baa77
tree9d1f12dc4c4264d7eb933ac6662ee7269b111622
parent30677c82cdacb008da9d1f1b8edad56de9f7f715
Move int type methods out of dwarf2_per_cu_data

These methods rely on the current objfile to create types based on it.
Since dwarf2_per_cu_data is to become objfile-independent, these methods
need to mvoe.

int_type can be in dwarf2_per_objfile, as it only requires knowing about
the objfile.

addr_sized_int_type and addr_type also need to know about the DWARF
address type size, which is CU-specific.  The dwarf2_cu objects seems
like a good place for it, as it knows both about the current objfile and
the current CU.

gdb/ChangeLog:

* dwarf2/read.h (struct dwarf2_per_cu_data) <addr_type,
addr_sized_int_type>: Move to dwarf2_cu.
<int_type>: Move to dwarf2_per_objfile.
(struct dwarf2_per_objfile) <int_type>: Move here.
* dwarf2/read.c (struct dwarf2_cu) <addr_type,
addr_sized_int_type>: Move here.
(read_func_scope): Update.
(read_array_type): Update.
(read_tag_string_type): Update.
(attr_to_dynamic_prop): Update.
(dwarf2_per_cu_data::int_type): Rename to...
(dwarf2_per_objfile::int_type): ... this.
(dwarf2_per_cu_data::addr_sized_int_type): Rename to...
(dwarf2_cu::addr_sized_int_type): ... this.
(read_subrange_type): Update.
(dwarf2_per_cu_data::addr_type): Rename to...
(dwarf2_cu::addr_type): ... this.
(set_die_type): Update.
gdb/dwarf2/read.c
gdb/dwarf2/read.h