struct type *type;
format = gdbarch_floatformat_for_type (gdbarch, NULL, bits);
+ type_allocator alloc (objfile);
if (format)
type = init_float_type (objfile, bits, NULL, format);
else
- type = init_type (objfile, TYPE_CODE_ERROR, bits, NULL);
+ type = alloc.new_type (TYPE_CODE_ERROR, bits, NULL);
return type;
}
TARGET_CHAR_BIT. */
#endif
+ type_allocator alloc (objfile);
switch (-typenum)
{
case 1:
rettype = init_integer_type (objfile, 32, 1, "unsigned long");
break;
case 11:
- rettype = init_type (objfile, TYPE_CODE_VOID, TARGET_CHAR_BIT, "void");
+ rettype = alloc.new_type (TYPE_CODE_VOID, TARGET_CHAR_BIT, "void");
break;
case 12:
/* IEEE single precision (32 bit). */
floatformats_ieee_double);
break;
case 19:
- rettype = init_type (objfile, TYPE_CODE_ERROR, 0, "stringptr");
+ rettype = alloc.new_type (TYPE_CODE_ERROR, 0, "stringptr");
break;
case 20:
rettype = init_character_type (objfile, 8, 1, "character");
if (**pp == ';')
++(*pp);
+ type_allocator alloc (objfile);
if (type_bits == 0)
{
- struct type *type = init_type (objfile, TYPE_CODE_VOID,
- TARGET_CHAR_BIT, NULL);
+ struct type *type = alloc.new_type (TYPE_CODE_VOID,
+ TARGET_CHAR_BIT, nullptr);
if (unsigned_type)
type->set_is_unsigned (true);
if (n2bits == -1 || n3bits == -1)
return error_type (pp, objfile);
+ type_allocator alloc (objfile);
+
if (index_type)
goto handle_true_range;
/* A type defined as a subrange of itself, with bounds both 0, is void. */
if (self_subrange && n2 == 0 && n3 == 0)
- return init_type (objfile, TYPE_CODE_VOID, TARGET_CHAR_BIT, NULL);
+ return alloc.new_type (TYPE_CODE_VOID, TARGET_CHAR_BIT, nullptr);
/* If n3 is zero and n2 is positive, we want a floating type, and n2
is the width in bytes.