return;
/* Record the field count, allocate space for the array of fields. */
- TYPE_NFIELDS (type) = nfields;
- TYPE_FIELDS (type)
- = (struct field *) TYPE_ZALLOC (type, sizeof (struct field) * nfields);
+ type->set_num_fields (nfields);
+ type->set_fields
+ ((struct field *) TYPE_ZALLOC (type, sizeof (struct field) * nfields));
/* Copy the saved-up fields into the field vector. */
for (int i = 0; i < nfields; ++i)
{
struct ctf_nextfield &field = fip->fields[i];
- TYPE_FIELD (type, i) = field.field;
+ type->field (i) = field.field;
}
}
if (name != NULL)
{
- struct symbol *sym = allocate_symbol (ccp->of);
+ struct symbol *sym = new (&ccp->of->objfile_obstack) symbol;
OBJSTAT (ccp->of, n_syms++);
sym->set_language (language_c, &ccp->of->objfile_obstack);
gdb::unique_xmalloc_ptr<char> name (ctf_type_aname_raw (fp, tid));
if (name != NULL)
{
- sym = allocate_symbol (objfile);
+ sym = new (&objfile->objfile_obstack) symbol;
OBJSTAT (objfile, n_syms++);
sym->set_language (language_c, &objfile->objfile_obstack);
SYMBOL_ACLASS_INDEX (sym) = LOC_STATIC;
break;
case CTF_K_CONST:
- if (TYPE_CODE (SYMBOL_TYPE (sym)) == TYPE_CODE_VOID)
+ if (SYMBOL_TYPE (sym)->code () == TYPE_CODE_VOID)
SYMBOL_TYPE (sym) = objfile_type (objfile)->builtin_int;
break;
case CTF_K_TYPEDEF:
gdb::unique_xmalloc_ptr<char> name (ctf_type_aname_raw (fp, tid));
if (name != NULL && strlen (name.get() ) != 0)
- TYPE_NAME (type) = obstack_strdup (&of->objfile_obstack, name.get ());
+ type->set_name (obstack_strdup (&of->objfile_obstack, name.get ()));
kind = ctf_type_kind (fp, tid);
if (kind == CTF_K_UNION)
gdb::unique_xmalloc_ptr<char> name (ctf_type_aname_raw (fp, tid));
if (name != NULL && strlen (name.get ()) != 0)
- TYPE_NAME (type) = obstack_strdup (&of->objfile_obstack, name.get ());
+ type->set_name (obstack_strdup (&of->objfile_obstack, name.get ()));
type->set_code (TYPE_CODE_FUNC);
ctf_func_type_info (fp, tid, &cfi);
gdb::unique_xmalloc_ptr<char> name (ctf_type_aname_raw (fp, tid));
if (name != NULL && strlen (name.get ()) != 0)
- TYPE_NAME (type) = obstack_strdup (&of->objfile_obstack, name.get ());
+ type->set_name (obstack_strdup (&of->objfile_obstack, name.get ()));
type->set_code (TYPE_CODE_ENUM);
TYPE_LENGTH (type) = ctf_type_size (fp, tid);
base_type = copy_type (base_type);
inner_array = base_type;
- while (TYPE_CODE (TYPE_TARGET_TYPE (inner_array)) == TYPE_CODE_ARRAY)
+ while (TYPE_TARGET_TYPE (inner_array)->code () == TYPE_CODE_ARRAY)
{
TYPE_TARGET_TYPE (inner_array)
= copy_type (TYPE_TARGET_TYPE (inner_array));
complaint (_("ctf_add_var_cb: %s has NO type (%ld)"), name, id);
type = objfile_type (ccp->of)->builtin_error;
}
- sym = allocate_symbol (ccp->of);
+ sym = new (&ccp->of->objfile_obstack) symbol;
OBJSTAT (ccp->of, n_syms++);
SYMBOL_TYPE (sym) = type;
SYMBOL_DOMAIN (sym) = VAR_DOMAIN;
ftype = get_tid_type (ccp->of, tid);
if (finfo.ctc_flags & CTF_FUNC_VARARG)
TYPE_VARARGS (ftype) = 1;
- TYPE_NFIELDS (ftype) = argc;
+ ftype->set_num_fields (argc);
/* If argc is 0, it has a "void" type. */
if (argc != 0)
- TYPE_FIELDS (ftype)
- = (struct field *) TYPE_ZALLOC (ftype, argc * sizeof (struct field));
+ ftype->set_fields
+ ((struct field *) TYPE_ZALLOC (ftype, argc * sizeof (struct field)));
/* TYPE_FIELD_TYPE must never be NULL. Fill it with void_type, if failed
to find the argument type. */