* [COMMITTED PATCH] (lookup_global_symbol_from_objfile): Simplify.
@ 2014-12-11 17:59 Doug Evans
0 siblings, 0 replies; only message in thread
From: Doug Evans @ 2014-12-11 17:59 UTC (permalink / raw)
To: gdb-patches
Hi.
While reading the code I noticed another simplification possible,
after this one got applied:
https://sourceware.org/ml/gdb-patches/2014-12/msg00067.html
Regression tested on amd64-linux.
2014-12-11 Doug Evans <xdje42@gmail.com>
* symtab.c (lookup_symbol_in_objfile_symtabs): Delete forward decl.
(symbol *lookup_symbol_via_quick_fns): Ditto.
(lookup_symbol_in_objfile): Add forward decl.
(lookup_global_symbol_from_objfile): Simplify, call
lookup_symbol_in_objfile.
diff --git a/gdb/symtab.c b/gdb/symtab.c
index 483667d..54e4be4 100644
--- a/gdb/symtab.c
+++ b/gdb/symtab.c
@@ -80,15 +80,8 @@ struct symbol *lookup_local_symbol (const char *name,
enum language language);
static struct symbol *
- lookup_symbol_in_objfile_symtabs (struct objfile *objfile,
- int block_index, const char *name,
- const domain_enum domain);
-
-static
-struct symbol *lookup_symbol_via_quick_fns (struct objfile *objfile,
- int block_index,
- const char *name,
- const domain_enum domain);
+ lookup_symbol_in_objfile (struct objfile *objfile, int block_index,
+ const char *name, const domain_enum domain);
extern initialize_file_ftype _initialize_symtab;
@@ -1552,15 +1545,10 @@ lookup_global_symbol_from_objfile (struct objfile *main_objfile,
objfile;
objfile = objfile_separate_debug_iterate (main_objfile, objfile))
{
- struct symbol *sym;
-
- sym = lookup_symbol_in_objfile_symtabs (objfile, GLOBAL_BLOCK, name,
- domain);
- if (sym != NULL)
- return sym;
+ struct symbol *sym = lookup_symbol_in_objfile (objfile, GLOBAL_BLOCK,
+ name, domain);
- sym = lookup_symbol_via_quick_fns (objfile, GLOBAL_BLOCK, name, domain);
- if (sym)
+ if (sym != NULL)
return sym;
}
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2014-12-11 17:59 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-12-11 17:59 [COMMITTED PATCH] (lookup_global_symbol_from_objfile): Simplify Doug Evans
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).