diff options
author | Simon Marchi <simon.marchi@polymtl.ca> | 2021-09-26 16:34:28 -0400 |
---|---|---|
committer | Simon Marchi <simon.marchi@polymtl.ca> | 2021-10-29 16:44:21 -0400 |
commit | 2ad53ea10c14445d6074814bbdfe46bd787038cb (patch) | |
tree | 754f8b3ea284ae5ef76887619d2fb468b8067bd2 /gdb/gdbtypes.c | |
parent | d8557c3d229589c690a1bef92be434eb663e3bb6 (diff) |
gdb: remove TYPE_FIELD_LOC_KIND
Remove TYPE_FIELD_LOC_KIND, replace its uses with type::field +
field::loc_kind.
Change-Id: Ib124a26365df82ac1d23df7962d954192913bd90
Diffstat (limited to 'gdb/gdbtypes.c')
-rw-r--r-- | gdb/gdbtypes.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/gdb/gdbtypes.c b/gdb/gdbtypes.c index 8cfb9db280..981b9b337c 100644 --- a/gdb/gdbtypes.c +++ b/gdb/gdbtypes.c @@ -2154,7 +2154,7 @@ is_dynamic_type_internal (struct type *type, int top_level) return 1; /* If the field is at a fixed offset, then it is not dynamic. */ - if (TYPE_FIELD_LOC_KIND (type, i) != FIELD_LOC_KIND_DWARF_BLOCK) + if (type->field (i).loc_kind () != FIELD_LOC_KIND_DWARF_BLOCK) continue; /* Do not consider C++ virtual base types to be dynamic due to the field's offset being dynamic; these are @@ -2454,7 +2454,7 @@ compute_variant_fields_inner (struct type *type, { int idx = part.discriminant_index; - if (TYPE_FIELD_LOC_KIND (type, idx) != FIELD_LOC_KIND_BITPOS) + if (type->field (idx).loc_kind () != FIELD_LOC_KIND_BITPOS) error (_("Cannot determine struct field location" " (invalid location kind)")); @@ -2586,7 +2586,7 @@ resolve_dynamic_struct (struct type *type, if (field_is_static (&resolved_type->field (i))) continue; - if (TYPE_FIELD_LOC_KIND (resolved_type, i) == FIELD_LOC_KIND_DWARF_BLOCK) + if (resolved_type->field (i).loc_kind () == FIELD_LOC_KIND_DWARF_BLOCK) { struct dwarf2_property_baton baton; baton.property_type @@ -2610,7 +2610,7 @@ resolve_dynamic_struct (struct type *type, that verification indicates a bug in our code, the error is not severe enough to suggest to the user he stops his debugging session because of it. */ - if (TYPE_FIELD_LOC_KIND (resolved_type, i) != FIELD_LOC_KIND_BITPOS) + if (resolved_type->field (i).loc_kind () != FIELD_LOC_KIND_BITPOS) error (_("Cannot determine struct field location" " (invalid location kind)")); @@ -2625,7 +2625,7 @@ resolve_dynamic_struct (struct type *type, resolved_type->field (i).set_type (resolve_dynamic_type_internal (resolved_type->field (i).type (), &pinfo, 0)); - gdb_assert (TYPE_FIELD_LOC_KIND (resolved_type, i) + gdb_assert (resolved_type->field (i).loc_kind () == FIELD_LOC_KIND_BITPOS); new_bit_length = TYPE_FIELD_BITPOS (resolved_type, i); @@ -5558,7 +5558,8 @@ copy_type_recursive (struct objfile *objfile, copied_types)); if (type->field (i).name ()) new_type->field (i).set_name (xstrdup (type->field (i).name ())); - switch (TYPE_FIELD_LOC_KIND (type, i)) + + switch (type->field (i).loc_kind ()) { case FIELD_LOC_KIND_BITPOS: new_type->field (i).set_loc_bitpos (TYPE_FIELD_BITPOS (type, i)); @@ -5581,7 +5582,7 @@ copy_type_recursive (struct objfile *objfile, default: internal_error (__FILE__, __LINE__, _("Unexpected type field location kind: %d"), - TYPE_FIELD_LOC_KIND (type, i)); + type->field (i).loc_kind ()); } } } |