This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [patch 3/3 optional] Template Lookup
- From: Tom Tromey <tromey at redhat dot com>
- To: sami wagiaalla <swagiaal at redhat dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Wed, 18 Aug 2010 16:15:41 -0600
- Subject: Re: [patch 3/3 optional] Template Lookup
- References: <4C446F53.7000209@redhat.com>
>>>>> "Sami" == sami wagiaalla <swagiaal@redhat.com> writes:
Sami> This patch improves the output provided by patch 2 in the series. It
Sami> makes the meta symbol created for templates aware of its instanced
Sami> within scope.
Sami> + struct symbol_list_element* instance = symbol_get_template_instances (var);
Space before "*", not after. There are a few of these.
Sami> + new_instance->sym = instance;
Sami> + new_instance->next = sym->ginfo.value.instances;
Sami> + sym->ginfo.value.instances = new_instance;
You could save a little memory by making a "subclass" of symbol for just
these instances, and have the subclass include the link.
Sami> +extern struct symbol_list_element*
Sami> +symbol_get_template_instances (struct symbol* sym);
It seems like this could return a 'const struct symbol_list_element *'.
And perhaps accept a 'const struct symbol *'. I didn't really examine
the other patches for const opportunities, but I think it would be
worthwhile to look at.
Tom