Patchwork [3/9] Remove some unneeded initializations in minimal_symbol_reader

login
register
mail settings
Submitter Tom Tromey
Date March 7, 2019, 8:57 p.m.
Message ID <20190307205709.21919-4-tom@tromey.com>
Download mbox | patch
Permalink /patch/31775/
State New
Headers show

Comments

Tom Tromey - March 7, 2019, 8:57 p.m.
minimal_symbol_reader::record_full does not need to initialize any
minsym fields to 0, because that was already done implicitly via the
use of XCNEW when allocating the msym_bunch.

gdb/ChangeLog
2019-03-07  Tom Tromey  <tom@tromey.com>

	* minsyms.c (minimal_symbol_reader::record_full): Remove some
	initializations.
---
 gdb/ChangeLog |  5 +++++
 gdb/minsyms.c | 10 ----------
 2 files changed, 5 insertions(+), 10 deletions(-)

Patch

diff --git a/gdb/minsyms.c b/gdb/minsyms.c
index 6395cc4ccab..3c91853e780 100644
--- a/gdb/minsyms.c
+++ b/gdb/minsyms.c
@@ -1156,16 +1156,6 @@  minimal_symbol_reader::record_full (const char *name, int name_len,
   MSYMBOL_SECTION (msymbol) = section;
 
   MSYMBOL_TYPE (msymbol) = ms_type;
-  MSYMBOL_TARGET_FLAG_1 (msymbol) = 0;
-  MSYMBOL_TARGET_FLAG_2 (msymbol) = 0;
-  /* Do not use the SET_MSYMBOL_SIZE macro to initialize the size,
-     as it would also set the has_size flag.  */
-  msymbol->size = 0;
-
-  /* The hash pointers must be cleared! If they're not,
-     add_minsym_to_hash_table will NOT add this msymbol to the hash table.  */
-  msymbol->hash_next = NULL;
-  msymbol->demangled_hash_next = NULL;
 
   /* If we already read minimal symbols for this objfile, then don't
      ever allocate a new one.  */