binutils-gdb/gdb/dwarf2
Pedro Alves 314ad88df6 Use type_instance_flags more throughout
A later patch in this series will rewrite enum_flags fixing some API
holes.  That would cause build failures around code using
type_instance_flags.  Or rather, that should be using it, but wasn't.

This patch fixes it by using type_instance_flags throughout instead of
plain integers.

Note that we can't make the seemingly obvious change to struct
type::instance_flags:

 -  unsigned instance_flags : 9;
 +  ENUM_BITFIELD (type_instance_flag_value) instance_flags : 9;

Because G++ complains then that 9 bits isn't sufficient for holding
all values of type_instance_flag_value.

So the patch adds an type::instance_flags() method, which takes care
of casting appropriately, and adds a separate type::set_instance_flags
method, following the pattern of the ongoing TYPE_XXX macro
elimination.  This converts uses of TYPE_INSTANCE_FLAGS to
type::instance_flags() in the places where the code was already being
touched, but there are still many references to the
TYPE_INSTANCE_FLAGS macro left behind.  Those could/should be fully
replaced at some point.

gdb/ChangeLog:

	* avr-tdep.c (avr_address_class_type_flags): Return
	type_instance_flags.
	(avr_address_class_type_flags_to_name): Take a
	type_instance_flags.
	(avr_address_class_name_to_type_flags): Return bool and take a
	type_instance_flags.
	* d-lang.c (build_d_types): Use type::set_instance_flags.
	* ft32-tdep.c (ft32_address_class_type_flags): Return
	type_instance_flags.
	(ft32_address_class_type_flags_to_name): Take a
	type_instance_flags.
	(ft32_address_class_name_to_type_flags): Return bool and take a
	type_instance_flags.
	(ft32_gdbarch_init): Use type::set_instance_flags.
	* eval.c (fake_method::fake_method): Use type::set_instance_flags.
	* gdbarch.h, gdbarch.c: Regenerate.
	* gdbarch.sh (address_class_type_flags): Use type_instance_flags.
	(address_class_name_to_type_flags): Use type_instance_flags and
	bool.
	* gdbtypes.c (address_space_name_to_int)
	(address_space_int_to_name, make_qualified_type): Use
	type_instance_flags.
	(make_qualified_type): Use type_instance_flags and
	type::set_instance_flags.
	(make_type_with_address_space, make_cv_type, make_vector_type)
	(check_typedef): Use type_instance_flags.
	(recursive_dump_type): Cast type_instance_flags to unsigned for
	printing.
	(copy_type_recursive): Use type::set_instance_flags.
	(gdbtypes_post_init): Use type::set_instance_flags.
	* gdbtypes.h (struct type) <instance_flags>: Rename to ...
	<m_instance_flags>: ... this.
	<instance_flags, set_instance_flags>: New methods.
	(TYPE_INSTANCE_FLAGS): Use the instance_flags method.
	(SET_TYPE_INSTANCE_FLAGS): New.
	(address_space_name_to_int, address_space_int_to_name)
	(make_type_with_address_space): Pass flags using
	type_instance_flags instead of int.
	* stabsread.c (cleanup_undefined_types_noname): Use
	type::set_instance_flags.
	* s390-tdep.c (s390_address_class_type_flags): Return
	type_instance_flags.
	(s390_address_class_type_flags_to_name): Take a
	type_instance_flags.
	(s390_address_class_name_to_type_flags): Return bool and take a
	type_instance_flags.
	* type-stack.c (type_stack::follow_types): Use
	type_instance_flags.
	* dwarf2/read.c (read_tag_pointer_type): Use type_instance_flags.
2020-09-14 21:16:56 +01:00
..
abbrev.c Inline abbrev lookup 2020-05-27 11:48:19 -06:00
abbrev.h Inline abbrev lookup 2020-05-27 11:48:19 -06:00
attribute.c Attribute method inlining 2020-05-27 11:48:18 -06:00
attribute.h Attribute method inlining 2020-05-27 11:48:18 -06:00
comp-unit.c gdb: rename dwarf2_per_objfile variables/fields to per_objfile 2020-05-29 15:15:10 -04:00
comp-unit.h gdb: rename dwarf2_per_objfile variables/fields to per_objfile 2020-05-29 15:15:10 -04:00
die.h Rewrite new die_info methods 2020-03-26 09:28:26 -06:00
dwz.c Add dwz.c and dwz_file::read_string 2020-03-26 09:28:09 -06:00
dwz.h Add dwz.c and dwz_file::read_string 2020-03-26 09:28:09 -06:00
expr.c gdb: remove TYPE_UNSIGNED 2020-09-14 11:07:57 -04:00
expr.h Add dwarf2_per_objfile to dwarf_expr_context and dwarf2_frame_cache 2020-05-27 11:15:56 -04:00
frame-tailcall.c gdb: use bool in frame code 2020-08-04 14:53:10 -04:00
frame-tailcall.h Move DWARF code to dwarf2/ subdirectory 2020-02-08 13:40:59 -07:00
frame.c Add dwarf2_per_objfile to dwarf_expr_context and dwarf2_frame_cache 2020-05-27 11:15:56 -04:00
frame.h Don't forward-declare struct objfile in dwarf2/frame.h 2020-02-11 17:57:46 -07:00
index-cache.c gdb: rename dwarf2_per_objfile variables/fields to per_objfile 2020-05-29 15:15:10 -04:00
index-cache.h gdb: rename dwarf2_per_objfile variables/fields to per_objfile 2020-05-29 15:15:10 -04:00
index-common.c Move DWARF code to dwarf2/ subdirectory 2020-02-08 13:40:59 -07:00
index-common.h Move DWARF code to dwarf2/ subdirectory 2020-02-08 13:40:59 -07:00
index-write.c gdb: move regcache::regcaches to regcache.c 2020-08-06 16:23:48 -04:00
index-write.h gdb: rename dwarf2_per_objfile variables/fields to per_objfile 2020-05-29 15:15:10 -04:00
leb.c Move read_offset_1 to leb.c 2020-02-08 13:43:24 -07:00
leb.h Move two more functions to dwarf2/leb.h 2020-02-08 13:43:24 -07:00
line-header.c gdb: rename dwarf2_per_objfile variables/fields to per_objfile 2020-05-29 15:15:10 -04:00
line-header.h gdb: rename dwarf2_per_objfile variables/fields to per_objfile 2020-05-29 15:15:10 -04:00
loc.c gdb: remove TYPE_UNSIGNED 2020-09-14 11:07:57 -04:00
loc.h Remove dwarf2_per_cu_data::objfile () 2020-05-27 11:15:57 -04:00
macro.c gdb: rename dwarf2_per_objfile variables/fields to per_objfile 2020-05-29 15:15:10 -04:00
macro.h gdb: rename dwarf2_per_objfile variables/fields to per_objfile 2020-05-29 15:15:10 -04:00
read.c Use type_instance_flags more throughout 2020-09-14 21:16:56 +01:00
read.h gdb: replace function pointer with void * data with function_view 2020-08-09 18:26:48 -04:00
section.c Add dwarf2_section_info::read_string method 2020-03-26 09:28:14 -06:00
section.h Add dwarf2_section_info::read_string method 2020-03-26 09:28:14 -06:00
stringify.c Move DWARF-constant stringifying code to new file 2020-03-26 09:28:26 -06:00
stringify.h Move DWARF-constant stringifying code to new file 2020-03-26 09:28:26 -06:00