return get_objfile_arch (block_objfile (block));
}
-/* Return Nonzero if block a is lexically nested within block b,
- or if a and b have the same pc range.
- Return zero otherwise. */
+/* See block.h. */
-int
-contained_in (const struct block *a, const struct block *b)
+bool
+contained_in (const struct block *a, const struct block *b,
+ bool allow_nested)
{
if (!a || !b)
- return 0;
+ return false;
do
{
if (a == b)
- return 1;
+ return true;
/* If A is a function block, then A cannot be contained in B,
except if A was inlined. */
- if (BLOCK_FUNCTION (a) != NULL && !block_inlined_p (a))
- return 0;
+ if (!allow_nested && BLOCK_FUNCTION (a) != NULL && !block_inlined_p (a))
+ return false;
a = BLOCK_SUPERBLOCK (a);
}
while (a != NULL);
- return 0;
+ return false;
}
/* A helper function that checks whether PC is in the blockvector BL.
It returns the containing block if there is one, or else NULL. */
-static struct block *
+static const struct block *
find_block_in_blockvector (const struct blockvector *bl, CORE_ADDR pc)
{
- struct block *b;
+ const struct block *b;
int bot, top, half;
/* If we have an addrmap mapping code addresses to blocks, then use
that. */
if (BLOCKVECTOR_MAP (bl))
- return (struct block *) addrmap_find (BLOCKVECTOR_MAP (bl), pc);
+ return (const struct block *) addrmap_find (BLOCKVECTOR_MAP (bl), pc);
/* Otherwise, use binary search to find the last block that starts
before PC.
struct compunit_symtab *cust)
{
const struct blockvector *bl;
- struct block *b;
+ const struct block *b;
if (cust == NULL)
{
}
/* If BLOCK_NAMESPACE (block) is NULL, allocate it via OBSTACK and
- ititialize its members to zero. */
+ initialize its members to zero. */
static void
block_initialize_namespace (struct block *block, struct obstack *obstack)
zero/NULL. This is useful for creating "dummy" blocks that don't
correspond to actual source files.
- Warning: it sets the block's BLOCK_DICT to NULL, which isn't a
+ Warning: it sets the block's BLOCK_MULTIDICT to NULL, which isn't a
valid value. If you really don't want the block to have a
- dictionary, then you should subsequently set its BLOCK_DICT to
+ dictionary, then you should subsequently set its BLOCK_MULTIDICT to
dict_create_linear (obstack, NULL). */
struct block *
block = BLOCKVECTOR_BLOCK (COMPUNIT_BLOCKVECTOR (cust),
iterator->which);
- sym = dict_iterator_first (BLOCK_DICT (block), &iterator->dict_iter);
+ sym = mdict_iterator_first (BLOCK_MULTIDICT (block),
+ &iterator->mdict_iter);
}
else
- sym = dict_iterator_next (&iterator->dict_iter);
+ sym = mdict_iterator_next (&iterator->mdict_iter);
if (sym != NULL)
return sym;
initialize_block_iterator (block, iterator);
if (iterator->which == FIRST_LOCAL_BLOCK)
- return dict_iterator_first (block->dict, &iterator->dict_iter);
+ return mdict_iterator_first (block->multidict, &iterator->mdict_iter);
return block_iterator_step (iterator, 1);
}
block_iterator_next (struct block_iterator *iterator)
{
if (iterator->which == FIRST_LOCAL_BLOCK)
- return dict_iterator_next (&iterator->dict_iter);
+ return mdict_iterator_next (&iterator->mdict_iter);
return block_iterator_step (iterator, 0);
}
block = BLOCKVECTOR_BLOCK (COMPUNIT_BLOCKVECTOR (cust),
iterator->which);
- sym = dict_iter_match_first (BLOCK_DICT (block), name,
- &iterator->dict_iter);
+ sym = mdict_iter_match_first (BLOCK_MULTIDICT (block), name,
+ &iterator->mdict_iter);
}
else
- sym = dict_iter_match_next (name, &iterator->dict_iter);
+ sym = mdict_iter_match_next (name, &iterator->mdict_iter);
if (sym != NULL)
return sym;
initialize_block_iterator (block, iterator);
if (iterator->which == FIRST_LOCAL_BLOCK)
- return dict_iter_match_first (block->dict, name, &iterator->dict_iter);
+ return mdict_iter_match_first (block->multidict, name,
+ &iterator->mdict_iter);
return block_iter_match_step (iterator, name, 1);
}
struct block_iterator *iterator)
{
if (iterator->which == FIRST_LOCAL_BLOCK)
- return dict_iter_match_next (name, &iterator->dict_iter);
+ return mdict_iter_match_next (name, &iterator->mdict_iter);
return block_iter_match_step (iterator, name, 0);
}
const domain_enum domain)
{
struct symbol *sym, *other;
- struct dict_iterator dict_iter;
+ struct mdict_iterator mdict_iter;
lookup_name_info lookup_name (name, symbol_name_match_type::FULL);
|| BLOCK_SUPERBLOCK (BLOCK_SUPERBLOCK (block)) == NULL);
other = NULL;
- for (sym = dict_iter_match_first (block->dict, lookup_name, &dict_iter);
+ for (sym
+ = mdict_iter_match_first (block->multidict, lookup_name, &mdict_iter);
sym != NULL;
- sym = dict_iter_match_next (lookup_name, &dict_iter))
+ sym = mdict_iter_match_next (lookup_name, &mdict_iter))
{
if (SYMBOL_DOMAIN (sym) == domain)
return sym;