diff options
author | Simon Marchi <simon.marchi@efficios.com> | 2020-09-14 11:07:59 -0400 |
---|---|---|
committer | Simon Marchi <simon.marchi@efficios.com> | 2020-09-14 11:07:59 -0400 |
commit | 8f53807e5c957fb947fb8d61fc2583e2dcbd6f06 (patch) | |
tree | 649228e0a30a2999240fd9de4691f72a259dc536 /gdb/gdbtypes.h | |
parent | e46d3488de137cd5a01377513ff49e32595456af (diff) | |
download | binutils-gdb-8f53807e5c957fb947fb8d61fc2583e2dcbd6f06.tar.gz |
gdb: add type::target_is_stub / type::set_target_is_stub
Add the `target_is_stub` and `set_target_is_stub` methods on `struct
type`, in order to remove the `TYPE_TARGET_STUB` 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) <target_is_stub, set_target_is_stub>:
New methods.
(TYPE_TARGET_STUB): Use type::is_stub, change all write call
sites to use type::set_target_is_stub.
Change-Id: I9c71a89adc7ae8d018db9ee156f41c623be0484a
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 bceb1b87605..c6c25183609 100644 --- a/gdb/gdbtypes.h +++ b/gdb/gdbtypes.h @@ -222,7 +222,7 @@ DEF_ENUM_FLAGS_TYPE (enum type_instance_flag_value, type_instance_flags); based on the TYPE_LENGTH of the target type. Also, set for TYPE_CODE_TYPEDEF. */ -#define TYPE_TARGET_STUB(t) (TYPE_MAIN_TYPE (t)->flag_target_stub) +#define TYPE_TARGET_STUB(t) ((t)->target_is_stub ()) /* * This is a function type which appears to have a prototype. We need this for function calls in order to tell us if it's necessary @@ -841,7 +841,7 @@ struct main_type unsigned int m_flag_unsigned : 1; unsigned int m_flag_nosign : 1; unsigned int m_flag_stub : 1; - unsigned int flag_target_stub : 1; + unsigned int m_flag_target_stub : 1; unsigned int flag_prototyped : 1; unsigned int flag_varargs : 1; unsigned int flag_vector : 1; @@ -1092,6 +1092,16 @@ struct type this->main_type->m_flag_stub = is_stub; } + bool target_is_stub () const + { + return this->main_type->m_flag_target_stub; + } + + void set_target_is_stub (bool target_is_stub) + { + this->main_type->m_flag_target_stub = target_is_stub; + } + /* * 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; |