diff options
author | Tom Tromey <tom@tromey.com> | 2023-03-13 10:31:06 -0600 |
---|---|---|
committer | Tom Tromey <tom@tromey.com> | 2023-03-18 11:12:37 -0600 |
commit | 2d39ccd3d1773b26ed8178bcd77375175c48ee62 (patch) | |
tree | e4634ee4c847ad5e71d092188c6f38ab21ae2444 /gdb/opencl-lang.c | |
parent | 333859402c7968dc718dae73ca0fbddbe096fc51 (diff) | |
download | binutils-2d39ccd3d1773b26ed8178bcd77375175c48ee62.zip binutils-2d39ccd3d1773b26ed8178bcd77375175c48ee62.tar.gz binutils-2d39ccd3d1773b26ed8178bcd77375175c48ee62.tar.bz2 |
Unify arch_integer_type and init_integer_type
This unifies arch_integer_type and init_integer_type by using a type
allocator.
Reviewed-By: Simon Marchi <simon.marchi@efficios.com>
Diffstat (limited to 'gdb/opencl-lang.c')
-rw-r--r-- | gdb/opencl-lang.c | 33 |
1 files changed, 17 insertions, 16 deletions
diff --git a/gdb/opencl-lang.c b/gdb/opencl-lang.c index 9b5304f..94f865e 100644 --- a/gdb/opencl-lang.c +++ b/gdb/opencl-lang.c @@ -909,21 +909,22 @@ public: struct type *el_type, *char_type, *int_type; - char_type = el_type = add (arch_integer_type (gdbarch, 8, 0, "char")); + type_allocator alloc (gdbarch); + char_type = el_type = add (init_integer_type (alloc, 8, 0, "char")); BUILD_OCL_VTYPES (char, el_type); - el_type = add (arch_integer_type (gdbarch, 8, 1, "uchar")); + el_type = add (init_integer_type (alloc, 8, 1, "uchar")); BUILD_OCL_VTYPES (uchar, el_type); - el_type = add (arch_integer_type (gdbarch, 16, 0, "short")); + el_type = add (init_integer_type (alloc, 16, 0, "short")); BUILD_OCL_VTYPES (short, el_type); - el_type = add (arch_integer_type (gdbarch, 16, 1, "ushort")); + el_type = add (init_integer_type (alloc, 16, 1, "ushort")); BUILD_OCL_VTYPES (ushort, el_type); - int_type = el_type = add (arch_integer_type (gdbarch, 32, 0, "int")); + int_type = el_type = add (init_integer_type (alloc, 32, 0, "int")); BUILD_OCL_VTYPES (int, el_type); - el_type = add (arch_integer_type (gdbarch, 32, 1, "uint")); + el_type = add (init_integer_type (alloc, 32, 1, "uint")); BUILD_OCL_VTYPES (uint, el_type); - el_type = add (arch_integer_type (gdbarch, 64, 0, "long")); + el_type = add (init_integer_type (alloc, 64, 0, "long")); BUILD_OCL_VTYPES (long, el_type); - el_type = add (arch_integer_type (gdbarch, 64, 1, "ulong")); + el_type = add (init_integer_type (alloc, 64, 1, "ulong")); BUILD_OCL_VTYPES (ulong, el_type); el_type = add (arch_float_type (gdbarch, 16, "half", floatformats_ieee_half)); BUILD_OCL_VTYPES (half, el_type); @@ -933,14 +934,14 @@ public: BUILD_OCL_VTYPES (double, el_type); add (arch_boolean_type (gdbarch, 8, 1, "bool")); - add (arch_integer_type (gdbarch, 8, 1, "unsigned char")); - add (arch_integer_type (gdbarch, 16, 1, "unsigned short")); - add (arch_integer_type (gdbarch, 32, 1, "unsigned int")); - add (arch_integer_type (gdbarch, 64, 1, "unsigned long")); - add (arch_integer_type (gdbarch, gdbarch_ptr_bit (gdbarch), 1, "size_t")); - add (arch_integer_type (gdbarch, gdbarch_ptr_bit (gdbarch), 0, "ptrdiff_t")); - add (arch_integer_type (gdbarch, gdbarch_ptr_bit (gdbarch), 0, "intptr_t")); - add (arch_integer_type (gdbarch, gdbarch_ptr_bit (gdbarch), 1, "uintptr_t")); + add (init_integer_type (alloc, 8, 1, "unsigned char")); + add (init_integer_type (alloc, 16, 1, "unsigned short")); + add (init_integer_type (alloc, 32, 1, "unsigned int")); + add (init_integer_type (alloc, 64, 1, "unsigned long")); + add (init_integer_type (alloc, gdbarch_ptr_bit (gdbarch), 1, "size_t")); + add (init_integer_type (alloc, gdbarch_ptr_bit (gdbarch), 0, "ptrdiff_t")); + add (init_integer_type (alloc, gdbarch_ptr_bit (gdbarch), 0, "intptr_t")); + add (init_integer_type (alloc, gdbarch_ptr_bit (gdbarch), 1, "uintptr_t")); add (builtin_type (gdbarch)->builtin_void); /* Type of elements of strings. */ |