summaryrefslogtreecommitdiff
path: root/gdb/gnu-v3-abi.c
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2023-03-13 09:53:35 -0600
committerTom Tromey <tom@tromey.com>2023-03-18 11:12:37 -0600
commitcc495054ad5cd22cfc3b3de5fc962af7f6b4e8d5 (patch)
tree25e65ef71b881a1355bda4ea239258d578e09efd /gdb/gnu-v3-abi.c
parent95751990e40d88986205ba3c0719b8afd3da0e7e (diff)
downloadbinutils-gdb-cc495054ad5cd22cfc3b3de5fc962af7f6b4e8d5.tar.gz
Remove arch_type
This removes arch_type, replacing all uses with the new type allocator. Reviewed-By: Simon Marchi <simon.marchi@efficios.com>
Diffstat (limited to 'gdb/gnu-v3-abi.c')
-rw-r--r--gdb/gnu-v3-abi.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/gdb/gnu-v3-abi.c b/gdb/gnu-v3-abi.c
index 6d1a36623f8..a3e2d73f10a 100644
--- a/gdb/gnu-v3-abi.c
+++ b/gdb/gnu-v3-abi.c
@@ -125,6 +125,8 @@ get_gdb_vtable_type (struct gdbarch *arch)
struct type *ptr_to_void_fn_type
= builtin_type (arch)->builtin_func_ptr;
+ type_allocator alloc (arch);
+
/* ARCH can't give us the true ptrdiff_t type, so we guess. */
struct type *ptrdiff_type
= arch_integer_type (arch, gdbarch_ptr_bit (arch), 0, "ptrdiff_t");
@@ -170,7 +172,7 @@ get_gdb_vtable_type (struct gdbarch *arch)
/* We assumed in the allocation above that there were four fields. */
gdb_assert (field == (field_list + 4));
- t = arch_type (arch, TYPE_CODE_STRUCT, offset * TARGET_CHAR_BIT, NULL);
+ t = alloc.new_type (TYPE_CODE_STRUCT, offset * TARGET_CHAR_BIT, NULL);
t->set_num_fields (field - field_list);
t->set_fields (field_list);
t->set_name ("gdb_gnu_v3_abi_vtable");
@@ -1053,7 +1055,8 @@ build_std_type_info_type (struct gdbarch *arch)
gdb_assert (field == (field_list + 2));
- t = arch_type (arch, TYPE_CODE_STRUCT, offset * TARGET_CHAR_BIT, NULL);
+ t = type_allocator (arch).new_type (TYPE_CODE_STRUCT,
+ offset * TARGET_CHAR_BIT, nullptr);
t->set_num_fields (field - field_list);
t->set_fields (field_list);
t->set_name ("gdb_gnu_v3_type_info");