diff options
author | Tom Tromey <tom@tromey.com> | 2023-03-13 13:25:41 -0600 |
---|---|---|
committer | Tom Tromey <tom@tromey.com> | 2023-03-18 11:12:38 -0600 |
commit | 526648585ca87251acdda0a271f7c4b4591231ae (patch) | |
tree | bbcc884596ed6954dcc9be6ff57591cd973530ee /gdb/gdbtypes.c | |
parent | 9e76b17aa5a62d866d9446bcc397e35748596193 (diff) | |
download | binutils-526648585ca87251acdda0a271f7c4b4591231ae.zip binutils-526648585ca87251acdda0a271f7c4b4591231ae.tar.gz binutils-526648585ca87251acdda0a271f7c4b4591231ae.tar.bz2 |
Use type allocator for set types
This changes the set type creation function to accept a type
allocator, and updates all the callers. Note that symbol readers
should generally allocate on the relevant objfile, regardless of the
underlying type of the set, which is what this patch implements.
Reviewed-By: Simon Marchi <simon.marchi@efficios.com>
Diffstat (limited to 'gdb/gdbtypes.c')
-rw-r--r-- | gdb/gdbtypes.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/gdb/gdbtypes.c b/gdb/gdbtypes.c index 3c2fdc6..1b0adbd 100644 --- a/gdb/gdbtypes.c +++ b/gdb/gdbtypes.c @@ -1445,10 +1445,9 @@ lookup_string_range_type (struct type *string_char_type, } 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); |