Remove FIELD_BITPOD, replace its uses with field::loc_bitpos.
Change-Id: Idb99297e0170661254276c206383a7e9bf1a935a
anonymous object to the MSB of the field. We don't
have to do anything special since we don't need to
know the size of the anonymous object. */
- fp->set_loc_bitpos ((FIELD_BITPOS (*fp) + attr->constant_value (0)));
+ fp->set_loc_bitpos (fp->loc_bitpos () + attr->constant_value (0));
}
else
{
bit field. */
anonymous_size = TYPE_LENGTH (fp->type ());
}
- fp->set_loc_bitpos (FIELD_BITPOS (*fp)
- + anonymous_size * bits_per_byte
- - bit_offset - FIELD_BITSIZE (*fp));
+ fp->set_loc_bitpos (fp->loc_bitpos ()
+ + anonymous_size * bits_per_byte
+ - bit_offset - FIELD_BITSIZE (*fp));
}
}
switch (field1->loc_kind ())
{
case FIELD_LOC_KIND_BITPOS:
- if (FIELD_BITPOS (*field1) != FIELD_BITPOS (*field2))
+ if (field1->loc_bitpos () != field2->loc_bitpos ())
return false;
break;
case FIELD_LOC_KIND_ENUMVAL:
if (t->num_fields () > 1)
{
f->set_loc_bitpos
- ((FIELD_BITPOS (f[-1]) + (TYPE_LENGTH (f[-1].type ()) * TARGET_CHAR_BIT)));
+ (f[-1].loc_bitpos () + (TYPE_LENGTH (f[-1].type ()) * TARGET_CHAR_BIT));
if (alignment)
{
int left;
alignment *= TARGET_CHAR_BIT;
- left = FIELD_BITPOS (f[0]) % alignment;
+ left = f[0].loc_bitpos () % alignment;
if (left)
{
- f->set_loc_bitpos (FIELD_BITPOS (f[0]) + (alignment - left));
+ f->set_loc_bitpos (f[0].loc_bitpos () + (alignment - left));
TYPE_LENGTH (t) += (alignment - left) / TARGET_CHAR_BIT;
}
}
(TYPE_CPLUS_SPECIFIC(thistype)->virtual_field_bits == NULL ? 0 \
: B_TST(TYPE_CPLUS_SPECIFIC(thistype)->virtual_field_bits, (index)))
-#define FIELD_BITPOS(thisfld) ((thisfld).loc_bitpos ())
#define FIELD_ENUMVAL(thisfld) ((thisfld).loc_enumval ())
#define FIELD_STATIC_PHYSNAME(thisfld) ((thisfld).loc_physname ())
#define FIELD_STATIC_PHYSADDR(thisfld) ((thisfld).loc_physaddr ())
#define FIELD_BITSIZE(thisfld) ((thisfld).bitsize)
#define TYPE_FIELD_LOC_KIND(thistype, n) ((thistype)->field (n).loc_kind ())
-#define TYPE_FIELD_BITPOS(thistype, n) FIELD_BITPOS ((thistype)->field (n))
+#define TYPE_FIELD_BITPOS(thistype, n) ((thistype)->field (n).loc_bitpos ())
#define TYPE_FIELD_ENUMVAL(thistype, n) FIELD_ENUMVAL ((thistype)->field (n))
#define TYPE_FIELD_STATIC_PHYSNAME(thistype, n) FIELD_STATIC_PHYSNAME ((thistype)->field (n))
#define TYPE_FIELD_STATIC_PHYSADDR(thistype, n) FIELD_STATIC_PHYSADDR ((thistype)->field (n))
SCM_ASSERT_TYPE (type->code () != TYPE_CODE_ENUM,
self, SCM_ARG1, FUNC_NAME, _("non-enum type"));
- return scm_from_long (FIELD_BITPOS (*field));
+ return scm_from_long (field->loc_bitpos ());
}
/* (field-bitsize <gdb:field>) -> integer
= tyscm_get_field_smob_arg_unsafe (self, SCM_ARG1, FUNC_NAME);
struct field *field = tyscm_field_smob_to_field (f_smob);
- return scm_from_long (FIELD_BITPOS (*field));
+ return scm_from_long (field->loc_bitpos ());
}
/* (field-artificial? <gdb:field>) -> boolean
: MIPS_V0_REGNUM);
field < type->num_fields (); field++, regnum += 2)
{
- int offset = (FIELD_BITPOS (type->field (field))
- / TARGET_CHAR_BIT);
+ int offset = type->field (field).loc_bitpos () / TARGET_CHAR_BIT;
if (mips_debug)
fprintf_unfiltered (gdb_stderr, "Return float struct+%d\n",
offset);
for (field = 0, regnum = mips_regnum (gdbarch)->fp0;
field < type->num_fields (); field++, regnum += 2)
{
- int offset = (FIELD_BITPOS (type->fields ()[field])
- / TARGET_CHAR_BIT);
+ int offset = (type->fields ()[field].loc_bitpos () / TARGET_CHAR_BIT);
if (mips_debug)
fprintf_unfiltered (gdb_stderr, "Return float struct+%d\n",
offset);
}
}
- if (FIELD_BITPOS (fip->list->field) == 0
+ if (fip->list->field.loc_bitpos () == 0
&& FIELD_BITSIZE (fip->list->field) == 0)
{
/* This can happen in two cases: (1) at least for gcc 2.4.5 or so,
== gdbarch_int_bit (gdbarch))
)
&&
- FIELD_BITPOS (fip->list->field) % 8 == 0)
+ fip->list->field.loc_bitpos () % 8 == 0)
{
FIELD_BITSIZE (fip->list->field) = 0;
}