mirror of
https://github.com/bminor/binutils-gdb.git
synced 2025-11-16 04:24:43 +00:00
Convert symtab to use obstack_new, and have a real constructor. The filename, filename_for_id and m_compunit, members should really not change once the symtab has been created, so make these members private (m_compunit was already private) and set them just once from the constructor. The set_compunit function has been deleted, and new getter functions for filename and filename_for_id have been added. The language is also set at construction time, but can be updated later, so set the language in the constructor, but retain symtab::set_language for when the language needs to be updated. Prior to this patch the symtab was allocated with OBSTACK_ZALLOC which would zero out the symtab object. With the call to objstack_new fields in the symtab would no longer be initialised, so I've added default member initialisation for everything not set in the constructor. The interesting changes are in symtab.h, and symfile.c. Everything else is just updating to handle symfile::filename and symfile::filename_for_id becoming methods. Approved-By: Simon Marchi <simon.marchi@efficios.com>