diff options
author | Tom Tromey <tom@tromey.com> | 2023-01-16 17:16:44 -0700 |
---|---|---|
committer | Tom Tromey <tom@tromey.com> | 2023-02-19 12:51:05 -0700 |
commit | 46baa3c6cf679e53b233708f7d5efd543c1084d7 (patch) | |
tree | a909aa6e64da21c843407736e7907b941a4d1b38 /gdb/block.c | |
parent | 8f14fd112036be4300c81492a4659d518d9caf24 (diff) | |
download | gdb-46baa3c6cf679e53b233708f7d5efd543c1084d7.zip gdb-46baa3c6cf679e53b233708f7d5efd543c1084d7.tar.gz gdb-46baa3c6cf679e53b233708f7d5efd543c1084d7.tar.bz2 |
Convert block_objfile to method
This converts block_objfile to be a method. This was mostly written
by script.
Diffstat (limited to 'gdb/block.c')
-rw-r--r-- | gdb/block.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/gdb/block.c b/gdb/block.c index 5751a6b..d7d5f0b 100644 --- a/gdb/block.c +++ b/gdb/block.c @@ -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. */ |