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 2/3] Template Lookup


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


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