diff options
author | Simon Marchi <simon.marchi@efficios.com> | 2020-06-08 15:26:04 -0400 |
---|---|---|
committer | Simon Marchi <simon.marchi@efficios.com> | 2020-06-08 15:26:04 -0400 |
commit | 5d14b6e5d6525ce462c30501644922a10f8682eb (patch) | |
tree | 0f1ce729b9393dc161bbcc4fc70f5b7b0a3ff335 /gdb/gnu-v3-abi.c | |
parent | 3d967001ecd3b325fc39d7f53ebf7054d1ecd503 (diff) | |
download | gdb-5d14b6e5d6525ce462c30501644922a10f8682eb.zip gdb-5d14b6e5d6525ce462c30501644922a10f8682eb.tar.gz gdb-5d14b6e5d6525ce462c30501644922a10f8682eb.tar.bz2 |
gdb: add field::type / field::set_type
Add the `type` and `set_type` methods on `struct field`, in order to
remoremove the `FIELD_TYPE` macro. In this patch, the `FIELD_TYPE`
macro is changed to use `field::type`, so all the call sites that are
useused to set the field's type are changed to use `field::set_type`.
The next patch will remove `FIELD_TYPE` completely.
Note that because of the name clash between the existing field named
`type` and the new method, I renamed the field `m_type`. It is not
private per-se, because we can't make `struct field` a non-POD yet, but
it should be considered private anyway (not accessed outside `struct
field`).
gdb/ChangeLog:
* gdbtypes.h (struct field) <type, set_type>: New methods.
Rename `type` field to...
<m_type>: ... this. Change references throughout to use type or
set_type methods.
(FIELD_TYPE): Use field::type. Change call sites that modify
the field's type to use field::set_type instead.
Change-Id: Ie21f866e3b7f8a51ea49b722d07d272a724459a0
Diffstat (limited to 'gdb/gnu-v3-abi.c')
-rw-r--r-- | gdb/gnu-v3-abi.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/gdb/gnu-v3-abi.c b/gdb/gnu-v3-abi.c index 255cfd1..8209d1b 100644 --- a/gdb/gnu-v3-abi.c +++ b/gdb/gnu-v3-abi.c @@ -135,28 +135,28 @@ build_gdb_vtable_type (struct gdbarch *arch) /* ptrdiff_t vcall_and_vbase_offsets[0]; */ FIELD_NAME (*field) = "vcall_and_vbase_offsets"; - FIELD_TYPE (*field) = lookup_array_range_type (ptrdiff_type, 0, -1); + field->set_type (lookup_array_range_type (ptrdiff_type, 0, -1)); SET_FIELD_BITPOS (*field, offset * TARGET_CHAR_BIT); offset += TYPE_LENGTH (FIELD_TYPE (*field)); field++; /* ptrdiff_t offset_to_top; */ FIELD_NAME (*field) = "offset_to_top"; - FIELD_TYPE (*field) = ptrdiff_type; + field->set_type (ptrdiff_type); SET_FIELD_BITPOS (*field, offset * TARGET_CHAR_BIT); offset += TYPE_LENGTH (FIELD_TYPE (*field)); field++; /* void *type_info; */ FIELD_NAME (*field) = "type_info"; - FIELD_TYPE (*field) = void_ptr_type; + field->set_type (void_ptr_type); SET_FIELD_BITPOS (*field, offset * TARGET_CHAR_BIT); offset += TYPE_LENGTH (FIELD_TYPE (*field)); field++; /* void (*virtual_functions[0]) (); */ FIELD_NAME (*field) = "virtual_functions"; - FIELD_TYPE (*field) = lookup_array_range_type (ptr_to_void_fn_type, 0, -1); + field->set_type (lookup_array_range_type (ptr_to_void_fn_type, 0, -1)); SET_FIELD_BITPOS (*field, offset * TARGET_CHAR_BIT); offset += TYPE_LENGTH (FIELD_TYPE (*field)); field++; @@ -1039,14 +1039,14 @@ build_std_type_info_type (struct gdbarch *arch) /* The vtable. */ FIELD_NAME (*field) = "_vptr.type_info"; - FIELD_TYPE (*field) = void_ptr_type; + field->set_type (void_ptr_type); SET_FIELD_BITPOS (*field, offset * TARGET_CHAR_BIT); offset += TYPE_LENGTH (FIELD_TYPE (*field)); field++; /* The name. */ FIELD_NAME (*field) = "__name"; - FIELD_TYPE (*field) = char_ptr_type; + field->set_type (char_ptr_type); SET_FIELD_BITPOS (*field, offset * TARGET_CHAR_BIT); offset += TYPE_LENGTH (FIELD_TYPE (*field)); field++; |