if (set_type)
return set_type;
- set_type = create_set_type (NULL, domain_type);
+ type_allocator alloc (cu->per_objfile->objfile);
+ set_type = create_set_type (alloc, domain_type);
attr = dwarf2_attr (die, DW_AT_byte_size, cu);
if (attr != nullptr && attr->form_is_unsigned ())
}
struct type *
-create_set_type (struct type *result_type, struct type *domain_type)
+create_set_type (type_allocator &alloc, struct type *domain_type)
{
- if (result_type == NULL)
- result_type = type_allocator (domain_type).new_type ();
+ struct type *result_type = alloc.new_type ();
result_type->set_code (TYPE_CODE_SET);
result_type->set_num_fields (1);
extern struct type *lookup_string_range_type (struct type *, LONGEST, LONGEST);
-extern struct type *create_set_type (struct type *, struct type *);
+extern struct type *create_set_type (type_allocator &alloc,
+ struct type *domain_type);
extern struct type *lookup_unsigned_typename (const struct language_defn *,
const char *);
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: