[PATCH] D29161: [APFloat] Reduce some dispatch boilerplates. NFC.

Eric Christopher via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 26 11:09:40 PST 2017


Shrug.

On Thu, Jan 26, 2017, 11:06 AM Justin Lebar via Phabricator <
reviews at reviews.llvm.org> wrote:

> jlebar added inline comments.
>
>
> ================
> Comment at: llvm/include/llvm/ADT/APFloat.h:24
>
> +#define APFLOAT_SINGLE_DISPATCH(METHOD_CALL)
>      \
> +  do {
>      \
> ----------------
> timshen wrote:
> > echristo wrote:
> > > timshen wrote:
> > > > echristo wrote:
> > > > > timshen wrote:
> > > > > > jlebar wrote:
> > > > > > > echristo wrote:
> > > > > > > > jlebar wrote:
> > > > > > > > > What does "single" refer to here?
> > > > > > > > >
> > > > > > > > > APFLOAT_SEMANTIC_DISPATCH?  I don't really like that
> either.
> > > > > > > > >
> > > > > > > > > Maybe someone else has a better suggestion.
> > > > > > > > APFLOAT_FORMAT_DISPATCH ?
> > > > > > > I like that one.
> > > > > > For single dispatch, see
> https://en.m.wikipedia.org/wiki/Dynamic_dispatch#Single_and_multiple_dispatch
> .
> > > > > >
> > > > > > Here the macro expands to code that dispatches on "*this"
> APFloat object. This isn't the case for add or convert.
> > > > > Most people will read the macro as a "what are we doing" rather
> than "how are we doing it" I think which is why I suggested format.
> > > > I actually don't know what "format" means here. How about
> APFLOAT_DISPATCH? :)
> > > You could also use layout dispatch. The idea is the "format" of the
> float. I just don't like layout, but that's also fine if you'd prefer it.
> > I see. Some how "format" reminded me of format string... oh well.
> >
> > Then the consistent term to use here is "semantics". How about
> APFLOAT_DISPATCH_ON_SEMANTICS?
> I'm also fine with that.
>
>
> https://reviews.llvm.org/D29161
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170126/d07ea0c1/attachment.html>


More information about the llvm-commits mailing list