int block_i;
/* The main source file's symtab. */
- struct symtab *symtab = COMPUNIT_FILETABS (cu);
+ struct symtab *symtab = cu->primary_filetab ();
for (block_i = 0; block_i < BLOCKVECTOR_NBLOCKS (blockvector); block_i++)
{
for (i = 0; i < pending->nsyms; ++i)
{
if (symbol_symtab (pending->symbol[i]) == NULL)
- symbol_set_symtab (pending->symbol[i], COMPUNIT_FILETABS (cu));
+ symbol_set_symtab (pending->symbol[i], cu->primary_filetab ());
}
}
}
compilation is from a C file generated by language preprocessors, do
not set the language if it was already deduced by start_subfile. */
if (!(cu->per_cu->lang == language_c
- && COMPUNIT_FILETABS (cust)->language != language_unknown))
- COMPUNIT_FILETABS (cust)->language = cu->per_cu->lang;
+ && cust->primary_filetab ()->language != language_unknown))
+ cust->primary_filetab ()->language = cu->per_cu->lang;
/* GCC-4.0 has started to support -fvar-tracking. GCC-3.x still can
produce DW_AT_location with location lists but it can be possibly
do not set the language if it was already deduced by
start_subfile. */
if (!(cu->per_cu->lang == language_c
- && COMPUNIT_FILETABS (cust)->language != language_c))
- COMPUNIT_FILETABS (cust)->language = cu->per_cu->lang;
+ && cust->primary_filetab ()->language != language_c))
+ cust->primary_filetab ()->language = cu->per_cu->lang;
}
}
else
});
cust = allocate_compunit_symtab (objfile, stab->file_name.c_str ());
- allocate_symtab (cust, stab->file_name.c_str ());
+ symtab *filetab = allocate_symtab (cust, stab->file_name.c_str ());
add_compunit_symtab_to_objfile (cust);
/* JIT compilers compile in memory. */
size_t size = ((stab->linetable->nitems - 1)
* sizeof (struct linetable_entry)
+ sizeof (struct linetable));
- SYMTAB_LINETABLE (COMPUNIT_FILETABS (cust))
+ SYMTAB_LINETABLE (filetab)
= (struct linetable *) obstack_alloc (&objfile->objfile_obstack, size);
- memcpy (SYMTAB_LINETABLE (COMPUNIT_FILETABS (cust)),
+ memcpy (SYMTAB_LINETABLE (filetab),
stab->linetable.get (), size);
}
/* The name. */
SYMBOL_DOMAIN (block_name) = VAR_DOMAIN;
SYMBOL_ACLASS_INDEX (block_name) = LOC_BLOCK;
- symbol_set_symtab (block_name, COMPUNIT_FILETABS (cust));
+ symbol_set_symtab (block_name, filetab);
SYMBOL_TYPE (block_name) = lookup_function_type (block_type);
SYMBOL_BLOCK_VALUE (block_name) = new_block;
for (compunit_symtab *cu : objfile->compunits ())
{
- struct symtab *symtab = COMPUNIT_FILETABS (cu);
+ struct symtab *symtab = cu->primary_filetab ();
iterate_over_file_blocks (symtab, lookup_name, name_domain,
callback);
/* The proper language was already determined when building
the psymtab, use it. */
- COMPUNIT_FILETABS (cust)->language = PST_PRIVATE (pst)->pst_language;
+ cust->primary_filetab ()->language = PST_PRIVATE (pst)->pst_language;
}
- psymtab_language = COMPUNIT_FILETABS (cust)->language;
+ psymtab_language = cust->primary_filetab ()->language;
- lines = SYMTAB_LINETABLE (COMPUNIT_FILETABS (cust));
+ lines = SYMTAB_LINETABLE (cust->primary_filetab ());
/* Get a new lexical context. */
push_parse_stack ();
- top_stack->cur_st = COMPUNIT_FILETABS (cust);
+ top_stack->cur_st = cust->primary_filetab ();
top_stack->cur_block
= BLOCKVECTOR_BLOCK (COMPUNIT_BLOCKVECTOR (cust), STATIC_BLOCK);
BLOCK_START (top_stack->cur_block) = pst->text_low (objfile);
size = lines->nitems;
if (size > 1)
--size;
- SYMTAB_LINETABLE (COMPUNIT_FILETABS (cust))
+ SYMTAB_LINETABLE (cust->primary_filetab ())
= ((struct linetable *)
obstack_copy (&mdebugread_objfile->objfile_obstack,
lines, (sizeof (struct linetable)
/* .. and our share of externals.
XXX use the global list to speed up things here. How?
FIXME, Maybe quit once we have found the right number of ext's? */
- top_stack->cur_st = COMPUNIT_FILETABS (cust);
+ top_stack->cur_st = cust->primary_filetab ();
top_stack->cur_block
= BLOCKVECTOR_BLOCK (SYMTAB_BLOCKVECTOR (top_stack->cur_st),
GLOBAL_BLOCK);
{
printf_filtered (_("File %s contains %d unresolved references:"),
symtab_to_filename_for_display
- (COMPUNIT_FILETABS (cust)),
+ (cust->primary_filetab ()),
n_undef_symbols);
printf_filtered ("\n\t%4d variables\n\t%4d "
"procedures\n\t%4d labels\n",
}
pop_parse_stack ();
- sort_blocks (COMPUNIT_FILETABS (cust));
+ sort_blocks (cust->primary_filetab ());
}
/* Now link the psymtab and the symtab. */
}
else
{
+ compunit_symtab *compunit = SYMTAB_COMPUNIT (symtab);
const char *compunit_filename
- = symtab_to_filename_for_display (COMPUNIT_FILETABS (SYMTAB_COMPUNIT (symtab)));
+ = symtab_to_filename_for_display (compunit->primary_filetab ());
fprintf_filtered (outfile,
"\nBlockvector same as owning compunit: %s\n\n",
if (cust->user != nullptr)
{
const char *addr
- = host_address_to_string (COMPUNIT_FILETABS (cust->user));
+ = host_address_to_string (cust->user->primary_filetab ());
fprintf_filtered (outfile, "Compunit user: %s\n", addr);
}
if (cust->includes != nullptr)
if (include == nullptr)
break;
const char *addr
- = host_address_to_string (COMPUNIT_FILETABS (include));
+ = host_address_to_string (include->primary_filetab ());
fprintf_filtered (outfile, "Compunit include: %s\n", addr);
}
}
using compunit_symtab_range = next_range<compunit_symtab>;
-#define COMPUNIT_FILETABS(cust) (*(cust)->filetabs ().begin ())
#define COMPUNIT_DEBUGFORMAT(cust) ((cust)->debugformat)
#define COMPUNIT_PRODUCER(cust) ((cust)->producer)
#define COMPUNIT_DIRNAME(cust) ((cust)->dirname)
static inline bool
is_main_symtab_of_compunit_symtab (struct symtab *symtab)
{
- return symtab == COMPUNIT_FILETABS (SYMTAB_COMPUNIT (symtab));
+ return symtab == SYMTAB_COMPUNIT (symtab)->primary_filetab ();
}
\f