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

Tim Shen via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 26 10:34:08 PST 2017


timshen added inline comments.


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


https://reviews.llvm.org/D29161





More information about the llvm-commits mailing list