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)
- TYPE_CODE (type) = TYPE_CODE_UNION;
+ type->set_code (TYPE_CODE_UNION);
else
- TYPE_CODE (type) = TYPE_CODE_STRUCT;
+ type->set_code (TYPE_CODE_STRUCT);
TYPE_LENGTH (type) = ctf_type_size (fp, tid);
set_type_align (type, ctf_type_align (fp, tid));
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_CODE (type) = TYPE_CODE_FUNC;
+ type->set_code (TYPE_CODE_FUNC);
ctf_func_type_info (fp, tid, &cfi);
rettype = get_tid_type (of, cfi.ctc_return);
TYPE_TARGET_TYPE (type) = rettype;
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_CODE (type) = TYPE_CODE_ENUM;
+ type->set_code (TYPE_CODE_ENUM);
TYPE_LENGTH (type) = ctf_type_size (fp, tid);
ctf_func_type_info (fp, tid, &fi);
target_type = get_tid_type (of, fi.ctc_return);
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;