This is the mail archive of the
archer@sourceware.org
mailing list for the Archer project.
Re: [RFC] Koenig lookup patch 2
- From: Tom Tromey <tromey at redhat dot com>
- To: Sami Wagiaalla <swagiaal at redhat dot com>
- Cc: Project Archer <archer at sourceware dot org>
- Date: Wed, 29 Apr 2009 18:19:39 -0600
- Subject: Re: [RFC] Koenig lookup patch 2
- References: <49BABABE.9080606@redhat.com> <m3d4clrs4z.fsf@fleche.redhat.com><49F87751.8050405@redhat.com>
- Reply-to: Tom Tromey <tromey at redhat dot com>
>>>>> "Sami" == Sami Wagiaalla <swagiaal@redhat.com> writes:
Sami> Recommit: Added support for ADL function lookup. Patch 2.
Thanks.
Sami> * c-exp.y: Created token UNKOWN_NAME.
FYI, a typo in the ChangeLog -- missing an "N".
A couple quick notes. I don't have time to pick nits... there were
some formatting issues and whatnot -- these have to be fixed but are
not very important overall.
Sami> @@ -2083,9 +2086,37 @@ find_overload_match (struct value **argvec, int nargs,
With the current code is there a need to have the values here?
Or could this be reverted to the trunk's approach?
Sami> + for (ix = 1; ix <= nargs; ix++){
Sami> arg_types[ix - 1] = value_type (argvec[ix]);
BTW, my earlier note about needing the formal types was in error.
I think GDB really only deals in formal types, unless it does special
work to find the dynamic type.
Sami> + if(cindex != NULL){
Sami> + prefix_len = (int)(cindex - type_name) - 1;
Sami> + prefix = alloca(prefix_len+1);
Sami> + strncpy(prefix, type_name, prefix_len);
Sami> + prefix[prefix_len] = '\0';
Sami> +
Sami> + concatenated_name = alloca (strlen (prefix) + 1 + strlen (name) + 1);
Sami> + strcpy(concatenated_name, prefix);
Sami> + strcat(concatenated_name, "::");
Sami> + strcat(concatenated_name, name);
This could be reduced to a single allocation.
Sami> + fsym = lookup_symbol(concatenated_name,NULL, VAR_DOMAIN, (int *) NULL);
Does this really do the right thing in the case where the call has
multiple arguments, each of which has a type from a different
namespace? I don't understand how those would get added to the
overload set.
Tom