summaryrefslogtreecommitdiff
path: root/gdb/gdbtypes.c
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2023-03-11 09:37:15 -0700
committerTom Tromey <tom@tromey.com>2023-03-18 11:12:38 -0600
commit426e5b66a738f4de185410a3e47a61423e0a7bdf (patch)
treecdd4cf12f4152688f4d46a7841d2ec27e3c90632 /gdb/gdbtypes.c
parent526648585ca87251acdda0a271f7c4b4591231ae (diff)
downloadbinutils-gdb-426e5b66a738f4de185410a3e47a61423e0a7bdf.tar.gz
Use builtin type when appropriate
There are a few spots that check whether a type is objfile-owned, and then choose either the objfile- or arch-specific builtin type. I don't think there is a need to do this any more (if there ever was), because it is ok for an objfile-allocated type to refer to an arch-allocated type. Reviewed-By: Simon Marchi <simon.marchi@efficios.com>
Diffstat (limited to 'gdb/gdbtypes.c')
-rw-r--r--gdb/gdbtypes.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/gdb/gdbtypes.c b/gdb/gdbtypes.c
index 1b0adbdbe05..6f206d8b050 100644
--- a/gdb/gdbtypes.c
+++ b/gdb/gdbtypes.c
@@ -1407,10 +1407,7 @@ lookup_array_range_type (struct type *element_type,
struct type *range_type;
type_allocator alloc (element_type);
- if (element_type->is_objfile_owned ())
- index_type = objfile_type (element_type->objfile_owner ())->builtin_int;
- else
- index_type = builtin_type (element_type->arch_owner ())->builtin_int;
+ index_type = builtin_type (element_type->arch ())->builtin_int;
range_type = create_static_range_type (alloc, index_type,
low_bound, high_bound);