Move int type methods out of dwarf2_per_cu_data
authorSimon Marchi <simon.marchi@efficios.com>
Wed, 27 May 2020 15:14:00 +0000 (11:14 -0400)
committerSimon Marchi <simon.marchi@efficios.com>
Wed, 27 May 2020 15:15:56 +0000 (11:15 -0400)
commit293e7e51145506f5f547a777242d7963f946c6ec
tree18688adf0a40c0a47e7a1c9c1c9918a9362c8539
parent64874a40306f556c290c8829f42526443db0f9e9
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.

Change-Id: Ic4708ef99d43a8d99325ff91dee59b2eb706cb8f
gdb/ChangeLog
gdb/dwarf2/read.c
gdb/dwarf2/read.h