Convert block_containing_function to method

This converts block_containing_function to be a method.  This was
mostly written by script.
This commit is contained in:
Tom Tromey
2023-01-16 17:48:19 -07:00
parent 3c9d050626
commit 99f3dfd0f9
4 changed files with 13 additions and 9 deletions

View File

@@ -100,14 +100,13 @@ block::linkage_function () const
return bl->function ();
}
/* Return the symbol for the function which contains a specified
block, described by a struct block BL. The return value will be
the closest enclosing function, which might be an inline
function. */
/* See block.h. */
struct symbol *
block_containing_function (const struct block *bl)
block::containing_function () const
{
const block *bl = this;
while (bl->function () == NULL && bl->superblock () != NULL)
bl = bl->superblock ();