/* Put the discriminant at index 0. */
type->field (0).set_type (field_type);
- TYPE_FIELD_ARTIFICIAL (type, 0) = 1;
+ type->field (0).set_is_artificial (true);
type->field (0).set_name ("<<discriminant>>");
type->field (0).set_loc_bitpos (bit_offset);
/* Install the discriminant at index 0 in the union. */
type->field (0) = *disr_field;
- TYPE_FIELD_ARTIFICIAL (type, 0) = 1;
+ type->field (0).set_is_artificial (true);
type->field (0).set_name ("<<discriminant>>");
/* We need a way to find the correct discriminant given a
pointer or virtual base class pointer) to private. */
if (dwarf2_attr (die, DW_AT_artificial, cu))
{
- FIELD_ARTIFICIAL (*fp) = 1;
+ fp->set_is_artificial (true);
new_field->accessibility = DW_ACCESS_private;
fip->non_public_fields = true;
}
struct field &upper = range_fields[range_fields.size () - 1];
lower.set_type (underlying);
- FIELD_ARTIFICIAL (lower) = 1;
+ lower.set_is_artificial (true);
upper.set_type (underlying);
- FIELD_ARTIFICIAL (upper) = 1;
+ upper.set_is_artificial (true);
if (!recognize_bound_expression (child_die, DW_AT_lower_bound,
&bounds_offset, &lower, cu)
4.5 does not yet generate. */
attr = dwarf2_attr (child_die, DW_AT_artificial, cu);
if (attr != nullptr)
- TYPE_FIELD_ARTIFICIAL (ftype, iparams) = attr->as_boolean ();
+ ftype->field (iparams).set_is_artificial (attr->as_boolean ());
else
- TYPE_FIELD_ARTIFICIAL (ftype, iparams) = 0;
+ ftype->field (iparams).set_is_artificial (false);
arg_type = die_type (child_die, cu);
/* RealView does not mark THIS as const, which the testsuite
for (i = 0; i < nfields; i++)
{
- TYPE_FIELD_ARTIFICIAL (new_type, i) =
- TYPE_FIELD_ARTIFICIAL (type, i);
+ new_type->field (i).set_is_artificial
+ (TYPE_FIELD_ARTIFICIAL (type, i));
TYPE_FIELD_BITSIZE (new_type, i) = TYPE_FIELD_BITSIZE (type, i);
if (type->field (i).type ())
new_type->field (i).set_type
m_name = name;
}
+ bool is_artificial () const
+ {
+ return m_artificial;
+ }
+
+ void set_is_artificial (bool is_artificial)
+ {
+ m_artificial = is_artificial;
+ }
+
/* Return true if this field is static; false if not. */
bool is_static () const
{
to the user. For TYPE_CODE_RANGE it is set if the specific
bound is not defined. */
- unsigned int artificial : 1;
+ unsigned int m_artificial : 1;
/* * Discriminant for union field_location. */
(TYPE_CPLUS_SPECIFIC(thistype)->virtual_field_bits == NULL ? 0 \
: B_TST(TYPE_CPLUS_SPECIFIC(thistype)->virtual_field_bits, (index)))
-#define FIELD_ARTIFICIAL(thisfld) ((thisfld).artificial)
+#define FIELD_ARTIFICIAL(thisfld) ((thisfld).is_artificial ())
#define FIELD_BITSIZE(thisfld) ((thisfld).bitsize)
#define TYPE_FIELD_ARTIFICIAL(thistype, n) FIELD_ARTIFICIAL((thistype)->field (n))
if (ptype->code () == TYPE_CODE_VOID)
ptype = builtin_type (objfile)->builtin_int;
ftype->field (nparams).set_type (ptype);
- TYPE_FIELD_ARTIFICIAL (ftype, nparams++) = 0;
+ ftype->field (nparams).set_is_artificial (false);
+ nparams++;
}
ftype->set_num_fields (nparams);
ftype->set_is_prototyped (true);