aboutsummaryrefslogtreecommitdiff
path: root/gdb/dwarf2
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2023-03-13 10:31:06 -0600
committerTom Tromey <tom@tromey.com>2023-03-18 11:12:37 -0600
commit2d39ccd3d1773b26ed8178bcd77375175c48ee62 (patch)
treee4634ee4c847ad5e71d092188c6f38ab21ae2444 /gdb/dwarf2
parent333859402c7968dc718dae73ca0fbddbe096fc51 (diff)
downloadgdb-2d39ccd3d1773b26ed8178bcd77375175c48ee62.zip
gdb-2d39ccd3d1773b26ed8178bcd77375175c48ee62.tar.gz
gdb-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/dwarf2')
-rw-r--r--gdb/dwarf2/expr.c9
-rw-r--r--gdb/dwarf2/read.c5
2 files changed, 10 insertions, 4 deletions
diff --git a/gdb/dwarf2/expr.c b/gdb/dwarf2/expr.c
index 2b41372..d245bc6 100644
--- a/gdb/dwarf2/expr.c
+++ b/gdb/dwarf2/expr.c
@@ -700,9 +700,12 @@ dwarf_expr_context::address_type () const
8 * this->m_addr_size);
if (types->dw_types[ndx] == NULL)
- types->dw_types[ndx]
- = arch_integer_type (arch, 8 * this->m_addr_size,
- 0, "<signed DWARF address type>");
+ {
+ type_allocator alloc (arch);
+ types->dw_types[ndx]
+ = init_integer_type (alloc, 8 * this->m_addr_size,
+ 0, "<signed DWARF address type>");
+ }
return types->dw_types[ndx];
}
diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c
index 2501007..d676f00 100644
--- a/gdb/dwarf2/read.c
+++ b/gdb/dwarf2/read.c
@@ -15036,7 +15036,10 @@ dwarf2_init_integer_type (struct dwarf2_cu *cu, struct objfile *objfile,
&& strcmp (name, "void") == 0)
type = objfile_type (objfile)->builtin_void;
else
- type = init_integer_type (objfile, bits, unsigned_p, name);
+ {
+ type_allocator alloc (objfile);
+ type = init_integer_type (alloc, bits, unsigned_p, name);
+ }
return type;
}