2009-10-23 Tristan Gingold <gingold@adacore.com>

* objfiles.c (allocate_objfile): Remove useless test.  Move
	declaration of last_one to the block that uses it.
This commit is contained in:
Tristan Gingold 2009-10-23 13:22:46 +00:00
parent 7fcab87103
commit 2f6e5d7e9d
2 changed files with 16 additions and 17 deletions

View File

@ -1,3 +1,8 @@
2009-10-23 Tristan Gingold <gingold@adacore.com>
* objfiles.c (allocate_objfile): Remove useless test. Move
declaration of last_one to the block that uses it.
2009-10-22 Paul Pluzhnikov <ppluzhnikov@google.com> 2009-10-22 Paul Pluzhnikov <ppluzhnikov@google.com>
* disasm.h (DISASSEMBLY_OMIT_FNAME) New define. * disasm.h (DISASSEMBLY_OMIT_FNAME) New define.

View File

@ -194,24 +194,16 @@ build_objfile_section_table (struct objfile *objfile)
struct objfile * struct objfile *
allocate_objfile (bfd *abfd, int flags) allocate_objfile (bfd *abfd, int flags)
{ {
struct objfile *objfile = NULL; struct objfile *objfile;
struct objfile *last_one = NULL;
/* If we don't support mapped symbol files, didn't ask for the file to be objfile = (struct objfile *) xmalloc (sizeof (struct objfile));
mapped, or failed to open the mapped file for some reason, then revert memset (objfile, 0, sizeof (struct objfile));
back to an unmapped objfile. */ objfile->psymbol_cache = bcache_xmalloc ();
objfile->macro_cache = bcache_xmalloc ();
if (objfile == NULL) /* We could use obstack_specify_allocation here instead, but
{ gdb_obstack.h specifies the alloc/dealloc functions. */
objfile = (struct objfile *) xmalloc (sizeof (struct objfile)); obstack_init (&objfile->objfile_obstack);
memset (objfile, 0, sizeof (struct objfile)); terminate_minimal_symbol_table (objfile);
objfile->psymbol_cache = bcache_xmalloc ();
objfile->macro_cache = bcache_xmalloc ();
/* We could use obstack_specify_allocation here instead, but
gdb_obstack.h specifies the alloc/dealloc functions. */
obstack_init (&objfile->objfile_obstack);
terminate_minimal_symbol_table (objfile);
}
objfile_alloc_data (objfile); objfile_alloc_data (objfile);
@ -266,6 +258,8 @@ allocate_objfile (bfd *abfd, int flags)
object_files = objfile; object_files = objfile;
else else
{ {
struct objfile *last_one;
for (last_one = object_files; for (last_one = object_files;
last_one->next; last_one->next;
last_one = last_one->next); last_one = last_one->next);