Replace with type::field + field::is_artificial.
Change-Id: Ie3bacae49d9bd02e83e504c1ce01470aba56a081
Approved-By: Tom Tromey <tom@tromey.com>
{
struct type *param_type;
- if (TYPE_FIELD_ARTIFICIAL (type, i) && linkage_name)
+ if (type->field (i).is_artificial () && linkage_name)
continue;
if (printed_any)
virtual table pointers are not specifically marked in
the debug info, they should be artificial. */
if ((i == vptr_fieldno && type == basetype)
- || TYPE_FIELD_ARTIFICIAL (type, i))
+ || type->field (i).is_artificial ())
continue;
if (need_access_label)
table pointers are not specifically marked in the debug info,
they should be artificial. */
if ((type == basetype && i == vptr_fieldno)
- || TYPE_FIELD_ARTIFICIAL (type, i))
+ || type->field (i).is_artificial ())
continue;
if (TYPE_FIELD_PROTECTED (type, i))
while (index >= 0)
{
if ((type == basetype && type_index == vptr_fieldno)
- || TYPE_FIELD_ARTIFICIAL (type, type_index))
+ || type->field (type_index).is_artificial ())
; /* ignore vptr */
else if (match_accessibility (type, type_index, acc))
--index;
const char *field_name = type->field (i).name ();
if (TYPE_FIELD_IGNORE (type, i)
- || TYPE_FIELD_ARTIFICIAL (type, i))
+ || type->field (i).is_artificial ())
continue;
/* GDB records unnamed/anonymous fields with empty string names. */
int artificials = 0;
for (int i = 0; i < type->num_fields (); ++i)
{
- if (strip_artificial && TYPE_FIELD_ARTIFICIAL (type, i))
+ if (strip_artificial && type->field (i).is_artificial ())
{
--array.n_elements;
++artificials;
artificial; there is no way to differentiate
the two cases. */
if (type->num_fields () > 0
- && TYPE_FIELD_ARTIFICIAL (type, 0)
+ && type->field (0).is_artificial ()
&& type->field (0).type ()->code () == TYPE_CODE_PTR
&& TYPE_CONST (type->field (0).type ()->target_type ()))
buf.puts (" const");
parameter for non-static member functions (which is the this
pointer) as artificial. We obtain this information from
read_subroutine_type via TYPE_FIELD_ARTIFICIAL. */
- if (nparams == 0 || TYPE_FIELD_ARTIFICIAL (this_type, 0) == 0)
+ if (nparams == 0 || this_type->field (0).is_artificial () == 0)
fnp->voffset = VOFFSET_STATIC;
}
else
we cannot actually find a base class context for the
vtable! */
if (this_type->num_fields () == 0
- || !TYPE_FIELD_ARTIFICIAL (this_type, 0))
+ || !this_type->field (0).is_artificial ())
{
complaint (_("cannot determine context for virtual member "
"function \"%s\" (offset %s)"),
but not in the class specifications (GCC PR 43053). */
if (cu->lang () == language_cplus
&& !TYPE_CONST (arg_type)
- && TYPE_FIELD_ARTIFICIAL (ftype, iparams))
+ && ftype->field (iparams).is_artificial ())
{
int is_this = 0;
struct dwarf2_cu *arg_cu = cu;
bool is_artificial = ((arg_num >= func_type->num_fields ())
? true
- : TYPE_FIELD_ARTIFICIAL (func_type, arg_num));
+ : func_type->field (arg_num).is_artificial ());
/* If this is an artificial argument, then either, this is an argument
beyond the end of the known arguments, or possibly, there are no known
for (i = 0; i < nfields; i++)
{
new_type->field (i).set_is_artificial
- (TYPE_FIELD_ARTIFICIAL (type, i));
+ (type->field (i).is_artificial ());
TYPE_FIELD_BITSIZE (new_type, i) = TYPE_FIELD_BITSIZE (type, i);
if (type->field (i).type ())
new_type->field (i).set_type
#define FIELD_BITSIZE(thisfld) ((thisfld).bitsize)
-#define TYPE_FIELD_ARTIFICIAL(thistype, n) ((thistype)->field (n).is_artificial ())
#define TYPE_FIELD_BITSIZE(thistype, n) FIELD_BITSIZE((thistype)->field (n))
#define TYPE_FIELD_PACKED(thistype, n) (FIELD_BITSIZE((thistype)->field (n))!=0)
artificial flag of the first parameter ('this' pointer). */
if (type->code () == TYPE_CODE_METHOD
&& type->num_fields () > 0
- && TYPE_FIELD_ARTIFICIAL (type, 0)
+ && type->field (0).is_artificial ()
&& type->field (0).type ()->code () == TYPE_CODE_PTR)
thiscall = 1;
if (PyObject_SetAttrString (result.get (), "name", arg.get ()) < 0)
return NULL;
- arg.reset (PyBool_FromLong (TYPE_FIELD_ARTIFICIAL (type, field)));
+ arg.reset (PyBool_FromLong (type->field (field).is_artificial ()));
if (PyObject_SetAttrString (result.get (), "artificial", arg.get ()) < 0)
return NULL;
{
/* The active variant is simply the first non-artificial field. */
for (int i = 0; i < type->num_fields (); ++i)
- if (!TYPE_FIELD_ARTIFICIAL (type, i))
+ if (!type->field (i).is_artificial ())
return i;
/* Perhaps we could get here by trying to print an Ada variant
{
if (type->field (i).is_static ())
continue;
- if (is_enum && TYPE_FIELD_ARTIFICIAL (type, i))
+ if (is_enum && type->field (i).is_artificial ())
continue;
fields.push_back (i);
}
QUIT;
gdb_assert (!type->field (i).is_static ());
- gdb_assert (! (is_enum && TYPE_FIELD_ARTIFICIAL (type, i)));
+ gdb_assert (! (is_enum && type->field (i).is_artificial ()));
if (flags->print_offsets)
podata->update (type, i, stream);
{
int start = 0;
- if (t1->num_fields () > 0 && TYPE_FIELD_ARTIFICIAL (t1, 0))
+ if (t1->num_fields () > 0 && t1->field (0).is_artificial ())
++start;
/* If skipping artificial fields, find the first real field
if (skip_artificial)
{
while (start < t1->num_fields ()
- && TYPE_FIELD_ARTIFICIAL (t1, start))
+ && t1->field (start).is_artificial ())
++start;
}