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

Eric Christopher via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 26 10:37:35 PST 2017


echristo added inline comments.


================
Comment at: llvm/include/llvm/ADT/APFloat.h:24
 
+#define APFLOAT_SINGLE_DISPATCH(METHOD_CALL)                                   \
+  do {                                                                         \
----------------
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.


https://reviews.llvm.org/D29161





More information about the llvm-commits mailing list