This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patch 3/3 optional] Template Lookup


>>>>> "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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]