{
struct type *target = TYPE_TARGET_TYPE (type);
struct type *real_target = TYPE_TARGET_TYPE (real_type);
{
struct type *target = TYPE_TARGET_TYPE (type);
struct type *real_target = TYPE_TARGET_TYPE (real_type);
- memcpy (TYPE_FIELDS (target),
- TYPE_FIELDS (real_target),
- field_size);
+ field *fields = (struct field *) TYPE_ALLOC (target, field_size);
+ memcpy (fields, real_target->fields (), field_size);
+ target->set_fields (fields);
- if (TYPE_NAME (target))
- xfree ((char*) TYPE_NAME (target));
- TYPE_NAME (target) = xstrdup (TYPE_NAME (real_target));
+ xfree ((char *) target->name ());
+ target->set_name (xstrdup (real_target->name ()));
from different files with the same name. */
if (SYMBOL_CLASS (real_sym) == LOC_TYPEDEF
&& SYMBOL_DOMAIN (real_sym) == VAR_DOMAIN
from different files with the same name. */
if (SYMBOL_CLASS (real_sym) == LOC_TYPEDEF
&& SYMBOL_DOMAIN (real_sym) == VAR_DOMAIN
&& TYPE_LENGTH (TYPE_TARGET_TYPE (SYMBOL_TYPE (real_sym))) != 0)
{
const char *name = real_sym->linkage_name ();
&& TYPE_LENGTH (TYPE_TARGET_TYPE (SYMBOL_TYPE (real_sym))) != 0)
{
const char *name = real_sym->linkage_name ();
SYMBOL_DOMAIN (sym) = VAR_DOMAIN;
/* If type has no name, give it one. */
SYMBOL_DOMAIN (sym) = VAR_DOMAIN;
/* If type has no name, give it one. */
- if (TYPE_CODE (SYMBOL_TYPE (sym)) == TYPE_CODE_PTR
- || TYPE_CODE (SYMBOL_TYPE (sym)) == TYPE_CODE_FUNC)
+ if (SYMBOL_TYPE (sym)->code () == TYPE_CODE_PTR
+ || SYMBOL_TYPE (sym)->code () == TYPE_CODE_FUNC)
{
/* If we are giving a name to a type such as
"pointer to foo" or "function returning foo", we
{
/* If we are giving a name to a type such as
"pointer to foo" or "function returning foo", we
not an empty structured type, though; the forward
references work themselves out via the magic of
coff_lookup_type. */
not an empty structured type, though; the forward
references work themselves out via the magic of
coff_lookup_type. */
/* Some compilers try to be helpful by inventing "fake"
names for anonymous enums, structures, and unions, like
"~0fake" or ".0fake". Thanks, but no thanks... */
/* Some compilers try to be helpful by inventing "fake"
names for anonymous enums, structures, and unions, like
"~0fake" or ".0fake". Thanks, but no thanks... */
if (sym->linkage_name () != NULL
&& *sym->linkage_name () != '~'
&& *sym->linkage_name () != '.')
if (sym->linkage_name () != NULL
&& *sym->linkage_name () != '~'
&& *sym->linkage_name () != '.')
- FIELD_TYPE (list->field) = decode_type (ms, ms->c_type,
- &sub_aux, objfile);
+ list->field.set_type (decode_type (ms, ms->c_type, &sub_aux,
+ objfile));
SET_FIELD_BITPOS (list->field, 8 * ms->c_value);
FIELD_BITSIZE (list->field) = 0;
nfields++;
SET_FIELD_BITPOS (list->field, 8 * ms->c_value);
FIELD_BITSIZE (list->field) = 0;
nfields++;
- FIELD_TYPE (list->field) = decode_type (ms, ms->c_type,
- &sub_aux, objfile);
+ list->field.set_type (decode_type (ms, ms->c_type, &sub_aux,
+ objfile));
SET_FIELD_BITPOS (list->field, ms->c_value);
FIELD_BITSIZE (list->field) = sub_aux.x_sym.x_misc.x_lnsz.x_size;
nfields++;
SET_FIELD_BITPOS (list->field, ms->c_value);
FIELD_BITSIZE (list->field) = sub_aux.x_sym.x_misc.x_lnsz.x_size;
nfields++;
- TYPE_NFIELDS (type) = nfields;
- TYPE_FIELDS (type) = (struct field *)
- TYPE_ALLOC (type, sizeof (struct field) * nfields);
+ type->set_num_fields (nfields);
+ type->set_fields
+ ((struct field *) TYPE_ALLOC (type, sizeof (struct field) * nfields));
name = obstack_strdup (&objfile->objfile_obstack, name);
sym->set_linkage_name (name);
name = obstack_strdup (&objfile->objfile_obstack, name);
sym->set_linkage_name (name);
- TYPE_CODE (type) = TYPE_CODE_ENUM;
- TYPE_NFIELDS (type) = nsyms;
- TYPE_FIELDS (type) = (struct field *)
- TYPE_ALLOC (type, sizeof (struct field) * nsyms);
+ type->set_code (TYPE_CODE_ENUM);
+ type->set_num_fields (nsyms);
+ type->set_fields
+ ((struct field *) TYPE_ALLOC (type, sizeof (struct field) * nsyms));
/* Find the symbols for the values and put them into the type.
The symbols can be found in the symlist that we put them on
/* Find the symbols for the values and put them into the type.
The symbols can be found in the symlist that we put them on
SYMBOL_TYPE (xsym) = type;
TYPE_FIELD_NAME (type, n) = xsym->linkage_name ();
SYMBOL_TYPE (xsym) = type;
TYPE_FIELD_NAME (type, n) = xsym->linkage_name ();
if (SYMBOL_VALUE (xsym) < 0)
unsigned_enum = 0;
TYPE_FIELD_BITSIZE (type, n) = 0;
if (SYMBOL_VALUE (xsym) < 0)
unsigned_enum = 0;
TYPE_FIELD_BITSIZE (type, n) = 0;