for (compunit_symtab *symtab : objfile->compunits ())
{
const struct block *block
- = BLOCKVECTOR_BLOCK (COMPUNIT_BLOCKVECTOR (symtab), block_kind);
+ = BLOCKVECTOR_BLOCK (symtab->blockvector (), block_kind);
if (!iterate_over_symbols_terminated (block, lookup_name,
domain, data))
break;
for (compunit_symtab *cu : objfile->compunits ())
{
const struct block *global_block
- = BLOCKVECTOR_BLOCK (COMPUNIT_BLOCKVECTOR (cu), GLOBAL_BLOCK);
+ = BLOCKVECTOR_BLOCK (cu->blockvector (), GLOBAL_BLOCK);
if (ada_add_block_renamings (result, global_block, lookup_name,
domain))
{
for (compunit_symtab *s : objfile->compunits ())
{
- const struct blockvector *bv = COMPUNIT_BLOCKVECTOR (s);
+ const struct blockvector *bv = s->blockvector ();
int i;
for (i = GLOBAL_BLOCK; i <= STATIC_BLOCK; i++)
for (compunit_symtab *s : objfile->compunits ())
{
QUIT;
- b = BLOCKVECTOR_BLOCK (COMPUNIT_BLOCKVECTOR (s), GLOBAL_BLOCK);
+ b = BLOCKVECTOR_BLOCK (s->blockvector (), GLOBAL_BLOCK);
ALL_BLOCK_SYMBOLS (b, iter, sym)
{
if (completion_skip_symbol (mode, sym))
for (compunit_symtab *s : objfile->compunits ())
{
QUIT;
- b = BLOCKVECTOR_BLOCK (COMPUNIT_BLOCKVECTOR (s), STATIC_BLOCK);
+ b = BLOCKVECTOR_BLOCK (s->blockvector (), STATIC_BLOCK);
/* Don't do this block twice. */
if (b == surrounding_static_block)
continue;
return 0;
}
- bl = COMPUNIT_BLOCKVECTOR (cust);
+ bl = cust->blockvector ();
/* Then search that symtab for the smallest block that wins. */
b = find_block_in_blockvector (bl, pc);
if (cust == NULL)
return NULL;
- block = BLOCKVECTOR_BLOCK (COMPUNIT_BLOCKVECTOR (cust),
+ block = BLOCKVECTOR_BLOCK (cust->blockvector (),
iterator->which);
sym = mdict_iterator_first (BLOCK_MULTIDICT (block),
&iterator->mdict_iter);
if (cust == NULL)
return NULL;
- block = BLOCKVECTOR_BLOCK (COMPUNIT_BLOCKVECTOR (cust),
+ block = BLOCKVECTOR_BLOCK (cust->blockvector (),
iterator->which);
sym = mdict_iter_match_first (BLOCK_MULTIDICT (block), name,
&iterator->mdict_iter);
/* Similarly for the producer. */
cu->set_producer (m_producer);
- COMPUNIT_BLOCKVECTOR (cu) = blockvector;
+ cu->set_blockvector (blockvector);
{
struct block *b = BLOCKVECTOR_BLOCK (blockvector, GLOBAL_BLOCK);
buildsym_compunit::augment_type_symtab ()
{
struct compunit_symtab *cust = m_compunit_symtab;
- const struct blockvector *blockvector = COMPUNIT_BLOCKVECTOR (cust);
+ const struct blockvector *blockvector = cust->blockvector ();
if (!m_context_stack.empty ())
complaint (_("Context stack not empty in augment_type_symtab"));
for (compunit_symtab *cust : objfile->compunits ())
{
QUIT;
- b = BLOCKVECTOR_BLOCK (COMPUNIT_BLOCKVECTOR (cust), GLOBAL_BLOCK);
+ b = BLOCKVECTOR_BLOCK (cust->blockvector (), GLOBAL_BLOCK);
add_symbol_overload_list_block (func_name, b, overload_list);
}
}
for (compunit_symtab *cust : objfile->compunits ())
{
QUIT;
- b = BLOCKVECTOR_BLOCK (COMPUNIT_BLOCKVECTOR (cust), STATIC_BLOCK);
+ b = BLOCKVECTOR_BLOCK (cust->blockvector (), STATIC_BLOCK);
/* Don't do this block twice. */
if (b == surrounding_static_block)
continue;
{
int i;
- if (COMPUNIT_BLOCKVECTOR (cust) != NULL
- && blockvector_contains_pc (COMPUNIT_BLOCKVECTOR (cust), pc))
+ if (cust->blockvector () != nullptr
+ && blockvector_contains_pc (cust->blockvector (), pc))
return cust;
if (cust->includes == NULL)
+ (actual_nblocks - 1) * sizeof (struct block *));
bv = (struct blockvector *) obstack_alloc (&objfile->objfile_obstack,
blockvector_size);
- COMPUNIT_BLOCKVECTOR (cust) = bv;
+ cust->set_blockvector (bv);
/* At the end of this function, (begin, end) will contain the PC range this
entire blockvector spans. */
for (compunit_symtab *cu : o->compunits ())
{
++nr_compunit_symtabs;
- nr_blocks += BLOCKVECTOR_NBLOCKS (COMPUNIT_BLOCKVECTOR (cu));
+ nr_blocks += BLOCKVECTOR_NBLOCKS (cu->blockvector ());
nr_symtabs += std::distance (cu->filetabs ().begin (),
cu->filetabs ().end ());
}
#else
s = mylookup_symbol
(sh_name,
- BLOCKVECTOR_BLOCK (COMPUNIT_BLOCKVECTOR (search_symtab),
+ BLOCKVECTOR_BLOCK (search_symtab->blockvector (),
STATIC_BLOCK),
VAR_DOMAIN,
LOC_BLOCK);
push_parse_stack ();
top_stack->cur_st = cust->primary_filetab ();
top_stack->cur_block
- = BLOCKVECTOR_BLOCK (COMPUNIT_BLOCKVECTOR (cust), STATIC_BLOCK);
+ = BLOCKVECTOR_BLOCK (cust->blockvector (), STATIC_BLOCK);
BLOCK_START (top_stack->cur_block) = pst->text_low (objfile);
BLOCK_END (top_stack->cur_block) = 0;
top_stack->blocktype = stFile;
+ BLOCKVECTOR_NBLOCKS (bv)
* sizeof (bv->block)));
if (bv != SYMTAB_BLOCKVECTOR (s))
- SYMTAB_BLOCKVECTOR (s) = bv;
+ SYMTAB_COMPUNIT (s)->set_blockvector (bv);
BLOCKVECTOR_BLOCK (bv, BLOCKVECTOR_NBLOCKS (bv)++) = b;
}
BLOCKVECTOR_BLOCK (bv, STATIC_BLOCK) = new_block (NON_FUNCTION_BLOCK, lang);
BLOCK_SUPERBLOCK (BLOCKVECTOR_BLOCK (bv, STATIC_BLOCK)) =
BLOCKVECTOR_BLOCK (bv, GLOBAL_BLOCK);
- COMPUNIT_BLOCKVECTOR (cust) = bv;
+ cust->set_blockvector (bv);
cust->set_debugformat ("ECOFF");
return cust;
for (compunit_symtab *cust : objfile->compunits ())
{
- const struct blockvector *bv = COMPUNIT_BLOCKVECTOR (cust);
+ const struct blockvector *bv = cust->blockvector ();
int block_line_section = COMPUNIT_BLOCK_LINE_SECTION (cust);
if (BLOCKVECTOR_MAP (bv))
/* Now do checks requiring the associated symtab. */
if (cust == NULL)
continue;
- bv = COMPUNIT_BLOCKVECTOR (cust);
+ bv = cust->blockvector ();
b = BLOCKVECTOR_BLOCK (bv, STATIC_BLOCK);
for (partial_symbol *psym : ps->static_psymbols)
{
const struct blockvector *bv;
const struct block *block;
- bv = COMPUNIT_BLOCKVECTOR (cust);
+ bv = cust->blockvector ();
block = BLOCKVECTOR_BLOCK (bv, STATIC_BLOCK);
if (block != nullptr)
auto search_one_symtab = [&] (compunit_symtab *stab)
{
struct symbol *sym, *with_opaque = NULL;
- const struct blockvector *bv = COMPUNIT_BLOCKVECTOR (stab);
+ const struct blockvector *bv = stab->blockvector ();
const struct block *block = BLOCKVECTOR_BLOCK (bv, kind);
sym = block_find_symbol (block, name, domain,
printf_filtered (" blockvector"
" ((struct blockvector *) %s)\n",
host_address_to_string
- (COMPUNIT_BLOCKVECTOR (cust)));
+ (cust->blockvector ()));
printf_filtered (" user"
" ((struct compunit_symtab *) %s)\n",
cust->user != nullptr
QUIT;
- if (COMPUNIT_BLOCKVECTOR (cust) == NULL)
+ if (cust->blockvector () == NULL)
found_something = 1;
/* Add more checks here. */
}
printf_filtered (" { symtab %s\n",
symtab_to_filename_for_display (symtab));
- if (COMPUNIT_BLOCKVECTOR (cust) == NULL)
+ if (cust->blockvector () == NULL)
printf_filtered (" NULL blockvector\n");
printf_filtered (" }\n");
}
const struct block *block;
struct block_symbol result;
- bv = COMPUNIT_BLOCKVECTOR (cust);
+ bv = cust->blockvector ();
block = BLOCKVECTOR_BLOCK (bv, block_index);
result.symbol = block_lookup_symbol_primary (block, name, domain);
result.block = block;
return {};
}
- bv = COMPUNIT_BLOCKVECTOR (cust);
+ bv = cust->blockvector ();
block = BLOCKVECTOR_BLOCK (bv, block_index);
result.symbol = block_lookup_symbol (block, name,
symbol_name_match_type::FULL, domain);
if (cust == NULL)
return NULL;
- bv = COMPUNIT_BLOCKVECTOR (cust);
+ bv = cust->blockvector ();
block = BLOCKVECTOR_BLOCK (bv, block_index);
sym = block_find_symbol (block, name, STRUCT_DOMAIN,
block_find_non_opaque_type, NULL);
for (compunit_symtab *cust : objfile->compunits ())
{
- bv = COMPUNIT_BLOCKVECTOR (cust);
+ bv = cust->blockvector ();
block = BLOCKVECTOR_BLOCK (bv, block_index);
sym = block_find_symbol (block, name, STRUCT_DOMAIN,
block_find_non_opaque_type, NULL);
{
for (compunit_symtab *cust : obj_file->compunits ())
{
- const struct blockvector *bv = COMPUNIT_BLOCKVECTOR (cust);
+ const struct blockvector *bv = cust->blockvector ();
const struct block *global_block
= BLOCKVECTOR_BLOCK (bv, GLOBAL_BLOCK);
CORE_ADDR start = BLOCK_START (global_block);
ADDR. */
auto search_symtab = [] (compunit_symtab *symtab, CORE_ADDR addr) -> symbol *
{
- const struct blockvector *bv = COMPUNIT_BLOCKVECTOR (symtab);
+ const struct blockvector *bv = symtab->blockvector ();
for (int i = GLOBAL_BLOCK; i <= STATIC_BLOCK; ++i)
{
return val;
}
- bv = COMPUNIT_BLOCKVECTOR (cust);
+ bv = cust->blockvector ();
/* Look at all the symtabs that share this blockvector.
They all have the same apriori range, that we found was right;
/* Add matching symbols (if not already present). */
for (compunit_symtab *cust : objfile->compunits ())
{
- const struct blockvector *bv = COMPUNIT_BLOCKVECTOR (cust);
+ const struct blockvector *bv = cust->blockvector ();
for (block_enum block : { GLOBAL_BLOCK, STATIC_BLOCK })
{
for (i = GLOBAL_BLOCK; i <= STATIC_BLOCK; i++)
{
QUIT;
- b = BLOCKVECTOR_BLOCK (COMPUNIT_BLOCKVECTOR (cust), i);
+ b = BLOCKVECTOR_BLOCK (cust->blockvector (), i);
ALL_BLOCK_SYMBOLS (b, iter, sym)
{
if (completion_skip_symbol (mode, sym))
#define SYMTAB_LINETABLE(symtab) ((symtab)->linetable)
#define SYMTAB_LANGUAGE(symtab) ((symtab)->language)
#define SYMTAB_BLOCKVECTOR(symtab) \
- COMPUNIT_BLOCKVECTOR (SYMTAB_COMPUNIT (symtab))
+ (SYMTAB_COMPUNIT (symtab)->blockvector ())
#define SYMTAB_OBJFILE(symtab) \
(SYMTAB_COMPUNIT (symtab)->objfile ())
#define SYMTAB_PSPACE(symtab) (SYMTAB_OBJFILE (symtab)->pspace)
m_dirname = dirname;
}
+ const struct blockvector *blockvector () const
+ {
+ return m_blockvector;
+ }
+
+ void set_blockvector (const struct blockvector *blockvector)
+ {
+ m_blockvector = blockvector;
+ }
+
/* Make PRIMARY_FILETAB the primary filetab of this compunit symtab.
PRIMARY_FILETAB must already be a filetab of this compunit symtab. */
/* List of all symbol scope blocks for this symtab. It is shared among
all symtabs in a given compilation unit. */
- const struct blockvector *blockvector;
+ const struct blockvector *m_blockvector;
/* Section in objfile->section_offsets for the blockvector and
the linetable. Probably always SECT_OFF_TEXT. */
using compunit_symtab_range = next_range<compunit_symtab>;
-#define COMPUNIT_BLOCKVECTOR(cust) ((cust)->blockvector)
#define COMPUNIT_BLOCK_LINE_SECTION(cust) ((cust)->block_line_section)
#define COMPUNIT_LOCATIONS_VALID(cust) ((cust)->locations_valid)
#define COMPUNIT_EPILOGUE_UNWIND_VALID(cust) ((cust)->epilogue_unwind_valid)