warning (_("GDB internal error: bad real_filenum"));
error_return:
- temp_type = objfile_type (objfile)->builtin_error;
+ temp_type = builtin_type (objfile)->builtin_error;
return &temp_type;
}
gdb_byte *dbl_valu;
struct type *dbl_type;
- dbl_type = objfile_type (objfile)->builtin_double;
+ dbl_type = builtin_type (objfile)->builtin_double;
dbl_valu
= (gdb_byte *) obstack_alloc (&objfile->objfile_obstack,
dbl_type->length ());
types; other languages probably should have at least
unsigned as well as signed constants. */
- sym->set_type (objfile_type (objfile)->builtin_long);
+ sym->set_type (builtin_type (objfile)->builtin_long);
sym->set_value_longest (atoi (p));
sym->set_aclass_index (LOC_CONST);
}
case 'c':
{
- sym->set_type (objfile_type (objfile)->builtin_char);
+ sym->set_type (builtin_type (objfile)->builtin_char);
sym->set_value_longest (atoi (p));
sym->set_aclass_index (LOC_CONST);
}
/* NULL terminate the string. */
string_local[ind] = 0;
+ type_allocator alloc (objfile);
range_type
- = create_static_range_type (NULL,
- objfile_type (objfile)->builtin_int,
+ = create_static_range_type (alloc,
+ builtin_type (objfile)->builtin_int,
0, ind);
sym->set_type
- (create_array_type (NULL, objfile_type (objfile)->builtin_char,
+ (create_array_type (alloc, builtin_type (objfile)->builtin_char,
range_type));
string_value
= (gdb_byte *) obstack_alloc (&objfile->objfile_obstack, ind + 1);
it back into builtin_int here.
FIXME: Do we need a new builtin_promoted_int_arg ? */
if (ptype->code () == TYPE_CODE_VOID)
- ptype = objfile_type (objfile)->builtin_int;
+ ptype = builtin_type (objfile)->builtin_int;
ftype->field (nparams).set_type (ptype);
TYPE_FIELD_ARTIFICIAL (ftype, nparams++) = 0;
}
{
sym->set_type
(sym->type ()->is_unsigned ()
- ? objfile_type (objfile)->builtin_unsigned_int
- : objfile_type (objfile)->builtin_int);
+ ? builtin_type (objfile)->builtin_unsigned_int
+ : builtin_type (objfile)->builtin_int);
}
break;
}
break;
}
}
- return objfile_type (objfile)->builtin_error;
+ return builtin_type (objfile)->builtin_error;
}
\f
break;
case 'S': /* Set type */
- type1 = read_type (pp, objfile);
- type = create_set_type (NULL, type1);
- if (typenums[0] != -1)
- *dbx_lookup_type (typenums, objfile) = type;
+ {
+ type1 = read_type (pp, objfile);
+ type_allocator alloc (objfile);
+ type = create_set_type (alloc, type1);
+ if (typenums[0] != -1)
+ *dbx_lookup_type (typenums, objfile) = type;
+ }
break;
default:
if (typenum >= 0 || typenum < -NUMBER_RECOGNIZED)
{
complaint (_("Unknown builtin type %d"), typenum);
- return objfile_type (objfile)->builtin_error;
+ return builtin_type (objfile)->builtin_error;
}
if (!negative_types)
upper = -1;
}
+ type_allocator alloc (objfile);
range_type =
- create_static_range_type (NULL, index_type, lower, upper);
- type = create_array_type (type, element_type, range_type);
+ create_static_range_type (alloc, index_type, lower, upper);
+ type_allocator smash_alloc (type, type_allocator::SMASH);
+ type = create_array_type (smash_alloc, element_type, range_type);
return type;
}
handle_true_range:
if (self_subrange)
- index_type = objfile_type (objfile)->builtin_int;
+ index_type = builtin_type (objfile)->builtin_int;
else
index_type = *dbx_lookup_type (rangenums, objfile);
if (index_type == NULL)
complaint (_("base type %d of range type is not defined"), rangenums[1]);
- index_type = objfile_type (objfile)->builtin_int;
+ index_type = builtin_type (objfile)->builtin_int;
}
result_type
- = create_static_range_type (NULL, index_type, n2, n3);
+ = create_static_range_type (alloc, index_type, n2, n3);
return (result_type);
}