From: Doug Evans <dje@google.com>
To: Siva Chandra <sivachandra@google.com>
Cc: gdb-patches <gdb-patches@sourceware.org>
Subject: Re: [RFC v2] Unnecessary argument METHOD to valops.c:find_oload_champ?
Date: Fri, 28 Feb 2014 20:33:00 -0000 [thread overview]
Message-ID: <CADPb22Q3VXYo+Hp5GcZFKE2w4hsvu_ZREcdEqGR3xS3MftkVKQ@mail.gmail.com> (raw)
In-Reply-To: <CAGyQ6gzMXpgtCCanBPB0hdo=f0GEqmJaFz+TKFYvv0CGccjNkA@mail.gmail.com>
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 ... :-)
next prev parent reply other threads:[~2014-02-28 20:33 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-02-28 14:33 Siva Chandra
2014-02-28 20:33 ` Doug Evans [this message]
2014-02-28 23:21 ` Siva Chandra
2014-02-28 23:24 ` Siva Chandra
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CADPb22Q3VXYo+Hp5GcZFKE2w4hsvu_ZREcdEqGR3xS3MftkVKQ@mail.gmail.com \
--to=dje@google.com \
--cc=gdb-patches@sourceware.org \
--cc=sivachandra@google.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).