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: [RFC v2] Unnecessary argument METHOD to valops.c:find_oload_champ?


On Fri, Feb 28, 2014 at 12:33 PM, Doug Evans <dje@google.com> wrote:
> On Fri, Feb 28, 2014 at 6:33 AM, Siva Chandra <sivachandra@google.com> wrote:
>> Realized I did not update function comment in v1.  Attached v2 which
>> includes a typo fix and updates the function comment.
>>
>> v1 posting: https://sourceware.org/ml/gdb-patches/2014-02/msg00833.html
>>
>> ChangeLog
>> 2014-02-28  Siva Chandra Reddy  <sivachandra@google.com>
>>
>>         * valops.c (find_oload_champ): Remove unneccesary argument METHOD
>>         (find_overload_match): Update call to find_oload_champ.
>>         (find_oload_champ_namespace_loop): Likewise
>>
>> Thanks,
>> Siva Chandra
>
> Hi.
>
> Ok with me, with one nit:
>
> I'd collapse this into just a single assert:
>
>    gdb_assert ((fns_ptr != NULL) + (oload_syms != NULL) == 1).
>
> ---
> +  int domain_count = (fns_ptr != NULL? 1 : 0) + (oload_syms != NULL ? 1 : 0);
> [...]
> +  /* A champion can be found among methods alone, or among functions
> +     alone, but not both.  */
> +  gdb_assert (domain_count == 1);
>
> Thanks!
>
> Btw, I see room for more cleanups.
>
> E.g., oload_method_static could use some TLC.
> - it's passed an enum for the method arg where we assume non-zero
> values are correct
> - IWBN to delete its method arg too
> - its result feels like it's intended to be true/false, but it's used
> as an integer
>   (rename function to oload_method_static_offset ?)
>
> I wouldn't make them part of the current patch, and feel free to pass.
> But since you're in the neighborhood ... :-)


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