* objfiles.c (get_objfile_bfd_data): Initialize macro_cache.
(free_objfile_per_bfd_storage): Destroy macro_cache.
(allocate_objfile, free_objfile): Update.
* objfiles.h (struct objfile_per_bfd_storage) <macro_cache>:
New field.
(struct objfile) <macro_cache>: Remove.
* symfile.c (reread_symbols): Update.
* symmisc.c (print_symbol_bcache_statistics): Update.
(print_objfile_statistics): Update.
+2012-08-22 Tom Tromey <tromey@redhat.com>
+
+ * dwarf2read.c (macro_start_file): Update.
+ * objfiles.c (get_objfile_bfd_data): Initialize macro_cache.
+ (free_objfile_per_bfd_storage): Destroy macro_cache.
+ (allocate_objfile, free_objfile): Update.
+ * objfiles.h (struct objfile_per_bfd_storage) <macro_cache>:
+ New field.
+ (struct objfile) <macro_cache>: Remove.
+ * symfile.c (reread_symbols): Update.
+ * symmisc.c (print_symbol_bcache_statistics): Update.
+ (print_objfile_statistics): Update.
+
2012-08-22 Tom Tromey <tromey@redhat.com>
* elfread.c (elf_symtab_read): Update.
/* We don't create a macro table for this compilation unit
at all until we actually get a filename. */
if (! pending_macros)
- pending_macros = new_macro_table (&objfile->objfile_obstack,
- objfile->macro_cache);
+ pending_macros = new_macro_table (&objfile->per_bfd->storage_obstack,
+ objfile->per_bfd->macro_cache);
if (! current_file)
{
obstack_init (&storage->storage_obstack);
storage->filename_cache = bcache_xmalloc (NULL, NULL);
+ storage->macro_cache = bcache_xmalloc (NULL, NULL);
}
return storage;
free_objfile_per_bfd_storage (struct objfile_per_bfd_storage *storage)
{
bcache_xfree (storage->filename_cache);
+ bcache_xfree (storage->macro_cache);
obstack_free (&storage->storage_obstack, 0);
}
objfile = (struct objfile *) xzalloc (sizeof (struct objfile));
objfile->psymbol_cache = psymbol_bcache_init ();
- objfile->macro_cache = bcache_xmalloc (NULL, NULL);
/* We could use obstack_specify_allocation here instead, but
gdb_obstack.h specifies the alloc/dealloc functions. */
obstack_init (&objfile->objfile_obstack);
xfree (objfile->static_psymbols.list);
/* Free the obstacks for non-reusable objfiles. */
psymbol_bcache_free (objfile->psymbol_cache);
- bcache_xfree (objfile->macro_cache);
if (objfile->demangled_names_hash)
htab_delete (objfile->demangled_names_hash);
obstack_free (&objfile->objfile_obstack, 0);
/* Byte cache for file names. */
struct bcache *filename_cache;
+
+ /* Byte cache for macros. */
+ struct bcache *macro_cache;
};
/* Master structure for keeping track of each file from which
will not change. */
struct psymbol_bcache *psymbol_cache; /* Byte cache for partial syms. */
- struct bcache *macro_cache; /* Byte cache for macros. */
/* Hash table for mapping symbol names to demangled names. Each
entry in the hash table is actually two consecutive strings,
/* Free the obstacks for non-reusable objfiles. */
psymbol_bcache_free (objfile->psymbol_cache);
objfile->psymbol_cache = psymbol_bcache_init ();
- bcache_xfree (objfile->macro_cache);
- objfile->macro_cache = bcache_xmalloc (NULL, NULL);
if (objfile->demangled_names_hash != NULL)
{
htab_delete (objfile->demangled_names_hash);
printf_filtered (_("Byte cache statistics for '%s':\n"), objfile->name);
print_bcache_statistics (psymbol_bcache_get_bcache (objfile->psymbol_cache),
"partial symbol cache");
- print_bcache_statistics (objfile->macro_cache, "preprocessor macro cache");
+ print_bcache_statistics (objfile->per_bfd->macro_cache,
+ "preprocessor macro cache");
print_bcache_statistics (objfile->per_bfd->filename_cache,
"file name cache");
}
bcache_memory_used (psymbol_bcache_get_bcache
(objfile->psymbol_cache)));
printf_filtered (_(" Total memory used for macro cache: %d\n"),
- bcache_memory_used (objfile->macro_cache));
+ bcache_memory_used (objfile->per_bfd->macro_cache));
printf_filtered (_(" Total memory used for file name cache: %d\n"),
bcache_memory_used (objfile->per_bfd->filename_cache));
}