diff options
author | Tom de Vries <tdevries@suse.de> | 2023-08-31 09:37:44 +0200 |
---|---|---|
committer | Tom de Vries <tdevries@suse.de> | 2023-08-31 09:37:44 +0200 |
commit | 6d3c2d749be8fe1be7d7ba11596e40531cf3cf7c (patch) | |
tree | b08522425d4962b4b5f4d2bf9d4b994975fc1dfc /gdb/dwarf2 | |
parent | 34c9386e218c8e981747412a7c4d1066d7e62f06 (diff) | |
download | binutils-6d3c2d749be8fe1be7d7ba11596e40531cf3cf7c.zip binutils-6d3c2d749be8fe1be7d7ba11596e40531cf3cf7c.tar.gz binutils-6d3c2d749be8fe1be7d7ba11596e40531cf3cf7c.tar.bz2 |
[gdb/symtab] Replace TYPE_ALLOC + B_CLRALL with TYPE_ZALLOC
I noticed some cases of TYPE_ALLOC followed by B_CLRALL.
Replace these with TYPE_ZALLOC.
Tested on x86_64-linux.
Approved-By: Tom Tromey <tom@tromey.com>
Diffstat (limited to 'gdb/dwarf2')
-rw-r--r-- | gdb/dwarf2/read.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c index 7fe0e84..bc68c29 100644 --- a/gdb/dwarf2/read.c +++ b/gdb/dwarf2/read.c @@ -12064,16 +12064,13 @@ dwarf2_attach_fields_to_type (struct field_info *fip, struct type *type, ALLOCATE_CPLUS_STRUCT_TYPE (type); TYPE_FIELD_PRIVATE_BITS (type) = - (B_TYPE *) TYPE_ALLOC (type, B_BYTES (nfields)); - B_CLRALL (TYPE_FIELD_PRIVATE_BITS (type), nfields); + (B_TYPE *) TYPE_ZALLOC (type, B_BYTES (nfields)); TYPE_FIELD_PROTECTED_BITS (type) = - (B_TYPE *) TYPE_ALLOC (type, B_BYTES (nfields)); - B_CLRALL (TYPE_FIELD_PROTECTED_BITS (type), nfields); + (B_TYPE *) TYPE_ZALLOC (type, B_BYTES (nfields)); TYPE_FIELD_IGNORE_BITS (type) = - (B_TYPE *) TYPE_ALLOC (type, B_BYTES (nfields)); - B_CLRALL (TYPE_FIELD_IGNORE_BITS (type), nfields); + (B_TYPE *) TYPE_ZALLOC (type, B_BYTES (nfields)); } /* If the type has baseclasses, allocate and clear a bit vector for @@ -12084,9 +12081,8 @@ dwarf2_attach_fields_to_type (struct field_info *fip, struct type *type, unsigned char *pointer; ALLOCATE_CPLUS_STRUCT_TYPE (type); - pointer = (unsigned char *) TYPE_ALLOC (type, num_bytes); + pointer = (unsigned char *) TYPE_ZALLOC (type, num_bytes); TYPE_FIELD_VIRTUAL_BITS (type) = pointer; - B_CLRALL (TYPE_FIELD_VIRTUAL_BITS (type), fip->baseclasses.size ()); TYPE_N_BASECLASSES (type) = fip->baseclasses.size (); } |