Convert block_objfile to method

This converts block_objfile to be a method.  This was mostly written
by script.
This commit is contained in:
Tom Tromey
2023-01-16 17:16:44 -07:00
parent 8f14fd1120
commit 46baa3c6cf
8 changed files with 20 additions and 20 deletions

View File

@@ -40,14 +40,14 @@ struct block_namespace_info : public allocate_on_obstack
/* See block.h. */
struct objfile *
block_objfile (const struct block *block)
block::objfile () const
{
const struct global_block *global_block;
if (block->function () != nullptr)
return block->function ()->objfile ();
if (function () != nullptr)
return function ()->objfile ();
global_block = (struct global_block *) block_global_block (block);
global_block = (struct global_block *) block_global_block (this);
return global_block->compunit_symtab->objfile ();
}
@@ -59,7 +59,7 @@ block_gdbarch (const struct block *block)
if (block->function () != nullptr)
return block->function ()->arch ();
return block_objfile (block)->arch ();
return block->objfile ()->arch ();
}
/* See block.h. */
@@ -434,7 +434,7 @@ set_block_compunit_symtab (struct block *block, struct compunit_symtab *cu)
struct dynamic_prop *
block_static_link (const struct block *block)
{
struct objfile *objfile = block_objfile (block);
struct objfile *objfile = block->objfile ();
/* Only objfile-owned blocks that materialize top function scopes can have
static links. */