From patchwork Thu Dec 11 17:58:55 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Doug Evans X-Patchwork-Id: 4190 Received: (qmail 4649 invoked by alias); 11 Dec 2014 17:59:51 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 4551 invoked by uid 89); 11 Dec 2014 17:59:50 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.6 required=5.0 tests=AWL, BAYES_00, FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, SPF_PASS, UNWANTED_LANGUAGE_BODY autolearn=ham version=3.3.2 X-HELO: mail-pa0-f47.google.com Received: from mail-pa0-f47.google.com (HELO mail-pa0-f47.google.com) (209.85.220.47) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Thu, 11 Dec 2014 17:59:49 +0000 Received: by mail-pa0-f47.google.com with SMTP id kq14so5494234pab.34 for ; Thu, 11 Dec 2014 09:59:47 -0800 (PST) X-Received: by 10.68.131.163 with SMTP id on3mr18985406pbb.169.1418320787635; Thu, 11 Dec 2014 09:59:47 -0800 (PST) Received: from sspiff.org (173-13-178-50-sfba.hfc.comcastbusiness.net. [173.13.178.50]) by mx.google.com with ESMTPSA id c3sm1911469pbu.76.2014.12.11.09.59.45 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 11 Dec 2014 09:59:46 -0800 (PST) Received: by sspiff.org (sSMTP sendmail emulation); Thu, 11 Dec 2014 09:58:55 -0800 From: Doug Evans To: gdb-patches@sourceware.org Subject: [COMMITTED PATCH] (lookup_global_symbol_from_objfile): Simplify. Date: Thu, 11 Dec 2014 09:58:55 -0800 Message-ID: MIME-Version: 1.0 X-IsSubscribed: yes 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 * 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; }