From: Tom Tromey <tom@tromey.com>
To: gdb-patches@sourceware.org
Cc: Tom Tromey <tom@tromey.com>
Subject: [RFA v2 2/3] Make template_symbol derive from symbol
Date: Fri, 17 Nov 2017 19:26:00 -0000 [thread overview]
Message-ID: <20171117192547.3515-3-tom@tromey.com> (raw)
In-Reply-To: <20171117192547.3515-1-tom@tromey.com>
This changes template_symbol to derive from symbol, which seems a bit
cleaner; and also more consistent with rust_vtable_symbol.
2017-11-17 Tom Tromey <tom@tromey.com>
* dwarf2read.c (read_func_scope): Update.
* symtab.h (struct template_symbol): Derive from symbol.
<base>: Remove.
---
gdb/ChangeLog | 6 ++++++
gdb/dwarf2read.c | 2 +-
gdb/symtab.c | 2 +-
gdb/symtab.h | 11 +++--------
4 files changed, 11 insertions(+), 10 deletions(-)
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index c4d0457..1551654 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,11 @@
2017-11-17 Tom Tromey <tom@tromey.com>
+ * dwarf2read.c (read_func_scope): Update.
+ * symtab.h (struct template_symbol): Derive from symbol.
+ <base>: Remove.
+
+2017-11-17 Tom Tromey <tom@tromey.com>
+
* symtab.h (struct symbol) <is_rust_vtable>: New member.
(struct rust_vtable_symbol): New.
(find_symbol_at_address): Declare.
diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c
index 8283345..86b6996 100644
--- a/gdb/dwarf2read.c
+++ b/gdb/dwarf2read.c
@@ -12263,7 +12263,7 @@ read_func_scope (struct die_info *die, struct dwarf2_cu *cu)
|| child_die->tag == DW_TAG_template_value_param)
{
templ_func = allocate_template_symbol (objfile);
- templ_func->base.is_cplus_template_function = 1;
+ templ_func->is_cplus_template_function = 1;
break;
}
}
diff --git a/gdb/symtab.c b/gdb/symtab.c
index 38bc713..3d59367 100644
--- a/gdb/symtab.c
+++ b/gdb/symtab.c
@@ -5800,7 +5800,7 @@ allocate_template_symbol (struct objfile *objfile)
struct template_symbol *result;
result = OBSTACK_ZALLOC (&objfile->objfile_obstack, struct template_symbol);
- initialize_objfile_symbol_1 (&result->base);
+ initialize_objfile_symbol_1 (result);
return result;
}
diff --git a/gdb/symtab.h b/gdb/symtab.h
index 0845ae8..6ecce81 100644
--- a/gdb/symtab.h
+++ b/gdb/symtab.h
@@ -1166,16 +1166,11 @@ extern struct symtab *symbol_symtab (const struct symbol *symbol);
extern void symbol_set_symtab (struct symbol *symbol, struct symtab *symtab);
/* An instance of this type is used to represent a C++ template
- function. It includes a "struct symbol" as a kind of base class;
- users downcast to "struct template_symbol *" when needed. A symbol
- is really of this type iff SYMBOL_IS_CPLUS_TEMPLATE_FUNCTION is
- true. */
+ function. A symbol is really of this type iff
+ SYMBOL_IS_CPLUS_TEMPLATE_FUNCTION is true. */
-struct template_symbol
+struct template_symbol : public symbol
{
- /* The base class. */
- struct symbol base;
-
/* The number of template arguments. */
int n_template_arguments;
--
2.9.5
next prev parent reply other threads:[~2017-11-17 19:26 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-11-17 19:26 [RFA v2 0/3] Handle dereferencing Rust trait objects Tom Tromey
2017-11-17 19:26 ` [RFA v2 1/3] " Tom Tromey
2017-11-17 19:26 ` Tom Tromey [this message]
2017-11-17 19:26 ` [RFA v2 3/3] Use an enum to represent subclasses of symbol Tom Tromey
2017-11-17 19:43 ` [RFA v2 0/3] Handle dereferencing Rust trait objects Pedro Alves
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20171117192547.3515-3-tom@tromey.com \
--to=tom@tromey.com \
--cc=gdb-patches@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).