cp_lookup_symbol_nonlocal: Move definition closer to its subroutines.
authorDoug Evans <xdje42@gmail.com>
Wed, 10 Dec 2014 18:42:22 +0000 (10:42 -0800)
committerDoug Evans <xdje42@gmail.com>
Wed, 10 Dec 2014 18:42:22 +0000 (10:42 -0800)
gdb/ChangeLog:

* cp-namespace.c (cp_lookup_symbol_nonlocal): Move definition,
closer to its subroutines.

gdb/ChangeLog
gdb/cp-namespace.c

index 3f0973f..b6b8859 100644 (file)
@@ -1,5 +1,10 @@
 2014-12-10  Doug Evans  <xdje42@gmail.com>
 
+       * cp-namespace.c (cp_lookup_symbol_nonlocal): Move definition,
+       closer to its subroutines.
+
+2014-12-10  Doug Evans  <xdje42@gmail.com>
+
        * cp-namespace.c (lookup_symbol_file): Move next to only caller.
 
 2014-12-10  Doug Evans  <xdje42@gmail.com>
index a1abc91..692e177 100644 (file)
 #include "buildsym.h"
 #include "language.h"
 
-static struct symbol *lookup_namespace_scope (const char *name,
-                                             const struct block *block,
-                                             const domain_enum domain,
-                                             const char *scope,
-                                             int scope_len);
-
 static struct type *cp_lookup_transparent_type_loop (const char *name,
                                                     const char *scope,
                                                     int scope_len);
@@ -208,29 +202,6 @@ cp_is_anonymous (const char *namespace)
          != NULL);
 }
 
-/* The C++-specific version of name lookup for static and global
-   names.  This makes sure that names get looked for in all namespaces
-   that are in scope.  NAME is the natural name of the symbol that
-   we're looking for, BLOCK is the block that we're searching within,
-   DOMAIN says what kind of symbols we're looking for.  */
-
-struct symbol *
-cp_lookup_symbol_nonlocal (const char *name,
-                          const struct block *block,
-                          const domain_enum domain)
-{
-  struct symbol *sym;
-  const char *scope = block_scope (block);
-
-  sym = lookup_namespace_scope (name, block,
-                               domain, scope, 0);
-  if (sym != NULL)
-    return sym;
-
-  return cp_lookup_symbol_namespace (scope, name,
-                                    block, domain);
-}
-
 /* Look up NAME in BLOCK's static block and in global blocks.  If
    ANONYMOUS_NAMESPACE is nonzero, the symbol in question is located
    within an anonymous namespace.  If SEARCH is non-zero, search through
@@ -699,6 +670,29 @@ lookup_namespace_scope (const char *name,
                                        block, domain, 1);
 }
 
+/* The C++-specific version of name lookup for static and global
+   names.  This makes sure that names get looked for in all namespaces
+   that are in scope.  NAME is the natural name of the symbol that
+   we're looking for, BLOCK is the block that we're searching within,
+   DOMAIN says what kind of symbols we're looking for.  */
+
+struct symbol *
+cp_lookup_symbol_nonlocal (const char *name,
+                          const struct block *block,
+                          const domain_enum domain)
+{
+  struct symbol *sym;
+  const char *scope = block_scope (block);
+
+  sym = lookup_namespace_scope (name, block,
+                               domain, scope, 0);
+  if (sym != NULL)
+    return sym;
+
+  return cp_lookup_symbol_namespace (scope, name,
+                                    block, domain);
+}
+
 /* Search through the base classes of PARENT_TYPE for a base class
    named NAME and return its type.  If not found, return NULL.  */