diff options
author | Simon Marchi <simon.marchi@efficios.com> | 2020-09-14 11:08:02 -0400 |
---|---|---|
committer | Simon Marchi <simon.marchi@efficios.com> | 2020-09-14 11:08:02 -0400 |
commit | 2062087b358cc5320d52b32c50866dbd08fb2631 (patch) | |
tree | bbf2de8f0df655ce90cbc94e2edbab7b0082919e /gdb/gdbtypes.h | |
parent | a409645d13f6cddef4827cf7240c01ec3e09559c (diff) | |
download | gdb-2062087b358cc5320d52b32c50866dbd08fb2631.zip gdb-2062087b358cc5320d52b32c50866dbd08fb2631.tar.gz gdb-2062087b358cc5320d52b32c50866dbd08fb2631.tar.bz2 |
gdb: add type::is_vector / type::set_is_vector
Add the `is_vector` and `set_is_vector` methods on `struct type`, in
order to remove the `TYPE_VECTOR` macro. In this patch, the macro is
changed to use the getter, so all the call sites of the macro that are
used as a setter are changed to use the setter method directly. The
next patch will remove the macro completely.
gdb/ChangeLog:
* gdbtypes.h (struct type) <is_vector, set_is_vector>: New methods.
(TYPE_VECTOR): Use type::is_vector, change all write call sites to
use type::set_is_vector.
Change-Id: I415e8d169f058662e0750329bfa4017bea3ca0cb
Diffstat (limited to 'gdb/gdbtypes.h')
-rw-r--r-- | gdb/gdbtypes.h | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/gdb/gdbtypes.h b/gdb/gdbtypes.h index 86d2f8c..760d536 100644 --- a/gdb/gdbtypes.h +++ b/gdb/gdbtypes.h @@ -219,7 +219,7 @@ DEF_ENUM_FLAGS_TYPE (enum type_instance_flag_value, type_instance_flags); /* * Identify a vector type. Gcc is handling this by adding an extra attribute to the array type. We slurp that in as a new flag of a type. This is used only in dwarf2read.c. */ -#define TYPE_VECTOR(t) (TYPE_MAIN_TYPE (t)->flag_vector) +#define TYPE_VECTOR(t) ((t)->is_vector ()) /* * The debugging formats (especially STABS) do not contain enough information to represent all Ada types---especially those whose @@ -824,7 +824,7 @@ struct main_type unsigned int m_flag_target_stub : 1; unsigned int m_flag_prototyped : 1; unsigned int m_flag_varargs : 1; - unsigned int flag_vector : 1; + unsigned int m_flag_vector : 1; unsigned int flag_stub_supported : 1; unsigned int flag_gnu_ifunc : 1; unsigned int flag_fixed_instance : 1; @@ -1116,6 +1116,16 @@ struct type this->main_type->m_flag_varargs = has_varargs; } + bool is_vector () const + { + return this->main_type->m_flag_vector; + } + + void set_is_vector (bool is_vector) + { + this->main_type->m_flag_vector = is_vector; + } + /* * Return the dynamic property of the requested KIND from this type's list of dynamic properties. */ dynamic_prop *dyn_prop (dynamic_prop_node_kind kind) const; |