if (current_block == NULL)
return;
- current_function = block_linkage_function (current_block);
+ current_function = current_block->linkage_function ();
if (current_function == NULL)
return;
const struct language_defn *lang;
b = block_for_pc (ax->scope);
- func = block_linkage_function (b);
+ func = b->linkage_function ();
lang = language_def (func->language ());
sym = lookup_language_this (lang, b).symbol;
return false;
}
-
-/* Return the symbol for the function which contains a specified
- lexical block, described by a struct block BL. The return value
- will not be an inlined function; the containing function will be
- returned instead. */
+/* See block.h. */
struct symbol *
-block_linkage_function (const struct block *bl)
+block::linkage_function () const
{
+ const block *bl = this;
+
while ((bl->function () == NULL || bl->inlined_p ())
&& bl->superblock () != NULL)
bl = bl->superblock ();
void set_using (struct using_direct *using_decl, struct obstack *obstack);
+ /* Return the symbol for the function which contains a specified
+ lexical block, described by a struct block. The return value
+ will not be an inlined function; the containing function will be
+ returned instead. */
+
+ struct symbol *linkage_function () const;
+
/* Addresses in the executable code that are in this block. */
CORE_ADDR m_start;
struct block *m_blocks[1];
};
-extern struct symbol *block_linkage_function (const struct block *);
-
extern struct symbol *block_containing_function (const struct block *);
/* Return true if block A is lexically nested within block B, or if a
bl = block_for_pc (pc);
if (bl)
{
- struct symbol *symbol = block_linkage_function (bl);
+ struct symbol *symbol = bl->linkage_function ();
if (symbol)
{
if (b == 0)
return 0;
- return block_linkage_function (b);
+ return b->linkage_function ();
}
/* Return the function containing pc value PC.
sal->symtab->compunit ());
if (bv != NULL)
{
- sym = block_linkage_function (b);
+ sym = b->linkage_function ();
if (sym != NULL)
sal->section
= sym->obj_section (sal->symtab->compunit ()->objfile ());
if (!b)
error (_("No block found for address"));
- framefunc = block_linkage_function (b);
+ framefunc = b->linkage_function ();
if (!framefunc)
error (_("No function found for block"));
/* Use block_linkage_function, which returns a real (not inlined)
function, instead of get_frame_function, which may return an
inlined function. */
- symbol *framefunc = block_linkage_function (bl);
+ symbol *framefunc = bl->linkage_function ();
/* If we found a frame-relative symbol then it was certainly within
some function associated with a frame. If we can't find the frame,
struct symbol *pc_func = NULL;
if (pc_block)
- pc_func = block_linkage_function (pc_block);
+ pc_func = pc_block->linkage_function ();
if (pc_func && pc == pc_func->value_block ()->entry_pc ())
{
if (!b)
error (_("No block found for address"));
- framefunc = block_linkage_function (b);
+ framefunc = b->linkage_function ();
if (!framefunc)
error (_("No function found for block"));
error (_("No block found for address for symbol \"%s\"."),
symbol->print_name ());
- framefunc = block_linkage_function (b);
+ framefunc = b->linkage_function ();
if (!framefunc)
error (_("No function found for block for symbol \"%s\"."),
the current frame language to parse the expression. That's why
we do the following language detection only if the context block
has been specifically provided. */
- struct symbol *func = block_linkage_function (block);
+ struct symbol *func = block->linkage_function ();
if (func != NULL)
lang = language_def (func->language ());