gen_static_field (struct agent_expr *ax, struct axs_value *value,
                  struct type *type, int fieldno)
 {
-  if (TYPE_FIELD_LOC_KIND (type, fieldno) == FIELD_LOC_KIND_PHYSADDR)
+  if (type->field (fieldno).loc_kind () == FIELD_LOC_KIND_PHYSADDR)
     {
       ax_const_l (ax, TYPE_FIELD_STATIC_PHYSADDR (type, fieldno));
       value->kind = axs_lvalue_memory;
 
        {
          CORE_ADDR physaddr;
 
-         switch (TYPE_FIELD_LOC_KIND (type, i))
+         switch (type->field (i).loc_kind ())
            {
            case FIELD_LOC_KIND_PHYSADDR:
              {
       gdb::unique_xmalloc_ptr<char> fname
        = compile_cplus_instance::decl_name (type->field (i).name ());
 
-      if (TYPE_FIELD_LOC_KIND (type, i) != FIELD_LOC_KIND_ENUMVAL
+      if (type->field (i).loc_kind () != FIELD_LOC_KIND_ENUMVAL
          || fname == nullptr)
        continue;
 
 
          name = tail;
          if (*name != '$'
              || index >= field_type->num_fields ()
-             || (TYPE_FIELD_LOC_KIND (field_type, index)
+             || (field_type->field (index).loc_kind ()
                  != FIELD_LOC_KIND_BITPOS))
            {
              complaint (_("Could not parse Rust enum encoding string \"%s\""
       std::unordered_map<std::string, ULONGEST> discriminant_map;
       for (int i = 0; i < enum_type->num_fields (); ++i)
        {
-         if (TYPE_FIELD_LOC_KIND (enum_type, i) == FIELD_LOC_KIND_ENUMVAL)
+         if (enum_type->field (i).loc_kind () == FIELD_LOC_KIND_ENUMVAL)
            {
              const char *name
                = rust_last_path_segment (enum_type->field (i).name ());
 
              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
     {
       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)"));
 
       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
         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)"));
 
       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);
                                    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));
            default:
              internal_error (__FILE__, __LINE__,
                              _("Unexpected type field location kind: %d"),
-                             TYPE_FIELD_LOC_KIND (type, i));
+                             type->field (i).loc_kind ());
            }
        }
     }
 
 #define FIELD_ARTIFICIAL(thisfld) ((thisfld).artificial)
 #define FIELD_BITSIZE(thisfld) ((thisfld).bitsize)
 
-#define TYPE_FIELD_LOC_KIND(thistype, n) ((thistype)->field (n).loc_kind ())
 #define TYPE_FIELD_BITPOS(thistype, n) ((thistype)->field (n).loc_bitpos ())
 #define TYPE_FIELD_ENUMVAL(thistype, n) ((thistype)->field (n).loc_enumval ())
 #define TYPE_FIELD_STATIC_PHYSNAME(thistype, n) ((thistype)->field (n).loc_physname ())
 
     return TYPE_BASECLASS_BITPOS (type, index) / 8;
 
   /* If we have a DWARF expression for the offset, evaluate it.  */
-  if (TYPE_FIELD_LOC_KIND (type, index) == FIELD_LOC_KIND_DWARF_BLOCK)
+  if (type->field (index).loc_kind () == FIELD_LOC_KIND_DWARF_BLOCK)
     {
       struct dwarf2_property_baton baton;
       baton.property_type
 
        }
       else
        {
-         if (TYPE_FIELD_LOC_KIND (type, field) == FIELD_LOC_KIND_DWARF_BLOCK)
+         if (type->field (field).loc_kind () == FIELD_LOC_KIND_DWARF_BLOCK)
            arg = gdbpy_ref<>::new_reference (Py_None);
          else
            arg = gdb_py_object_from_longest (TYPE_FIELD_BITPOS (type, field));
 
 
   for (i = 0; i < count; ++i)
     {
-      if (TYPE_FIELD_LOC_KIND (type, i) != FIELD_LOC_KIND_BITPOS)
+      if (type->field (i).loc_kind () != FIELD_LOC_KIND_BITPOS)
        continue;
 
       struct type *field_type = type->field (i).type ();
 
       const char *fname = type->field (i).name ();
       int len;
 
-      if (TYPE_FIELD_LOC_KIND (type, i) != FIELD_LOC_KIND_ENUMVAL
+      if (type->field (i).loc_kind () != FIELD_LOC_KIND_ENUMVAL
          || fname == NULL)
        continue;
 
 
 {
   struct value *retval;
 
-  switch (TYPE_FIELD_LOC_KIND (type, fieldno))
+  switch (type->field (fieldno).loc_kind ())
     {
     case FIELD_LOC_KIND_PHYSADDR:
       retval = value_at_lazy (type->field (fieldno).type (),