static void
convert_symbol_sym (struct compile_c_instance *context, const char *identifier,
- struct symbol *sym, domain_enum domain)
+ struct block_symbol sym, domain_enum domain)
{
- const struct block *static_block, *found_block;
+ const struct block *static_block;
int is_local_symbol;
- found_block = block_found;
-
/* If we found a symbol and it is not in the static or global
scope, then we should first convert any static or global scope
symbol of the same name. This lets this unusual case work:
}
*/
- static_block = block_static_block (found_block);
+ static_block = block_static_block (sym.block);
/* STATIC_BLOCK is NULL if FOUND_BLOCK is the global block. */
- is_local_symbol = (found_block != static_block && static_block != NULL);
+ is_local_symbol = (sym.block != static_block && static_block != NULL);
if (is_local_symbol)
{
- struct symbol *global_sym;
+ struct block_symbol global_sym;
global_sym = lookup_symbol (identifier, NULL, domain, NULL);
/* If the outer symbol is in the static block, we ignore it, as
it cannot be referenced. */
- if (global_sym != NULL
- && block_found != block_static_block (block_found))
+ if (global_sym.symbol != NULL
+ && global_sym.block != block_static_block (global_sym.block))
{
if (compile_debug)
fprintf_unfiltered (gdb_stdlog,
"gcc_convert_symbol \"%s\": global symbol\n",
identifier);
- convert_one_symbol (context, global_sym, 1, 0);
+ convert_one_symbol (context, global_sym.symbol, 1, 0);
}
}
fprintf_unfiltered (gdb_stdlog,
"gcc_convert_symbol \"%s\": local symbol\n",
identifier);
- convert_one_symbol (context, sym, 0, is_local_symbol);
+ convert_one_symbol (context, sym.symbol, 0, is_local_symbol);
}
/* Convert a minimal symbol to its gcc form. CONTEXT is the compiler
is to simply emit a gcc error. */
TRY
{
- struct symbol *sym;
+ struct block_symbol sym;
sym = lookup_symbol (identifier, context->base.block, domain, NULL);
- if (sym != NULL)
+ if (sym.symbol != NULL)
{
convert_symbol_sym (context, identifier, sym, domain);
found = 1;
struct symbol *sym;
/* We only need global functions here. */
- sym = lookup_symbol (identifier, NULL, VAR_DOMAIN, NULL);
+ sym = lookup_symbol (identifier, NULL, VAR_DOMAIN, NULL).symbol;
if (sym != NULL && SYMBOL_CLASS (sym) == LOC_BLOCK)
{
if (compile_debug)