-/* See symtab.h. */
-
-struct block_symbol
-lookup_static_symbol (const char *name, const domain_enum domain)
-{
- struct symbol_cache *cache = get_symbol_cache (current_program_space);
- struct block_symbol result;
- struct block_symbol_cache *bsc;
- struct symbol_cache_slot *slot;
-
- /* Lookup in STATIC_BLOCK is not current-objfile-dependent, so just pass
- NULL for OBJFILE_CONTEXT. */
- result = symbol_cache_lookup (cache, NULL, STATIC_BLOCK, name, domain,
- &bsc, &slot);
- if (result.symbol != NULL)
- {
- if (SYMBOL_LOOKUP_FAILED_P (result))
- return {};
- return result;
- }
-
- for (objfile *objfile : current_program_space->objfiles ())
- {
- result = lookup_symbol_in_objfile (objfile, STATIC_BLOCK, name, domain);
- if (result.symbol != NULL)
- {
- /* Still pass NULL for OBJFILE_CONTEXT here. */
- symbol_cache_mark_found (bsc, slot, NULL, result.symbol,
- result.block);
- return result;
- }
- }
-
- /* Still pass NULL for OBJFILE_CONTEXT here. */
- symbol_cache_mark_not_found (bsc, slot, NULL, name, domain);
- return {};
-}
-