public inbox for gdb-cvs@sourceware.org
help / color / mirror / Atom feed
* [binutils-gdb] Have global_block inherit from block
@ 2023-02-19 23:38 Tom Tromey
  0 siblings, 0 replies; only message in thread
From: Tom Tromey @ 2023-02-19 23:38 UTC (permalink / raw)
  To: gdb-cvs

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=56c0cd6158851c2f870374a9c2114810dabac70b

commit 56c0cd6158851c2f870374a9c2114810dabac70b
Author: Tom Tromey <tom@tromey.com>
Date:   Fri Jan 20 07:14:46 2023 -0700

    Have global_block inherit from block
    
    This changes global_block to inherit from block, which is what was
    always intended.

Diff:
---
 gdb/block.c | 4 +---
 gdb/block.h | 6 +-----
 2 files changed, 2 insertions(+), 8 deletions(-)

diff --git a/gdb/block.c b/gdb/block.c
index 8f15cdf23f8..1698ee51e7b 100644
--- a/gdb/block.c
+++ b/gdb/block.c
@@ -397,9 +397,7 @@ allocate_block (struct obstack *obstack)
 struct block *
 allocate_global_block (struct obstack *obstack)
 {
-  struct global_block *bl = new (obstack) struct global_block;
-
-  return &bl->block;
+  return new (obstack) struct global_block;
 }
 
 /* See block.h.  */
diff --git a/gdb/block.h b/gdb/block.h
index 9a60140581d..3d71e7daab1 100644
--- a/gdb/block.h
+++ b/gdb/block.h
@@ -314,12 +314,8 @@ private:
 /* The global block is singled out so that we can provide a back-link
    to the compunit symtab.  */
 
-struct global_block : public allocate_on_obstack
+struct global_block : public block
 {
-  /* The block.  */
-
-  struct block block;
-
   /* This holds a pointer to the compunit symtab holding this block.  */
 
   struct compunit_symtab *compunit_symtab = nullptr;

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-02-19 23:38 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-19 23:38 [binutils-gdb] Have global_block inherit from block Tom Tromey

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).