[PATCH] D66148: [SemanticTypedef] Provide a semantic typedef class and operators

David Greene via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 19 09:17:24 PDT 2019


greened marked an inline comment as done.
greened added inline comments.


================
Comment at: llvm/include/llvm/ADT/SemanticTypedef.h:183
+/// Define a macro to create unary operators.
+#define SEMANTIC_TYPEDEF_UNARY_OP(Op, ResultType)               \
+  friend ResultType operator Op(const Typedef &O) {             \
----------------
greened wrote:
> nliber wrote:
> > The downside to using macros here is that it makes it harder for users to debug code going through these macros.  It doesn't seem worth writing eight macros just to write six classes.
> If people feel strongly about it, I'm fine not using macros.  It will be a lot more code, though.
As a data point, I build with gcc 8.1 and errors were pretty easy to track down, even through the macros.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D66148/new/

https://reviews.llvm.org/D66148





More information about the llvm-commits mailing list