This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [patch 2/3] 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 15:59:09 -0600
- Subject: Re: [patch 2/3] Template Lookup
- References: <4C446F49.5070204@redhat.com>
>>>>> "Sami" == sami wagiaalla <swagiaal@redhat.com> writes:
Sami> This patch corrects that by introducing a meta variable representing
Sami> the template into the scope of the template instance.
I think this idea seems reasonable.
Sami> +static void
Sami> +add_template_variable (struct symbol *symbol, struct pending **listhead,
Sami> + struct objfile *objfile)
This needs an introductory comment.
Sami> + int i;
Sami> +
Sami> + struct cleanup *all_cleanups = make_cleanup (null_cleanup, NULL);
Remove that blank line.
Sami> + make_cleanup(xfree, tmp);
Space before open paren. There are a few of these.
Sami> + /* Has a template symbol for this symbol been added already ? */
Sami> + for (iterator = *(listhead);
Sami> + iterator != NULL;
Sami> + iterator = iterator->next)
I think this means that adding template symbols is O(N^2).
A temporary hash table for recording this info would be better.
Tom