[PATCH] D40915: Always evaluate the second argument for CHECK() lazily.

Rui Ueyama via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 6 13:41:23 PST 2017


ruiu added inline comments.


================
Comment at: lld/include/lld/Common/ErrorHandler.h:116
+
+#define CHECK(...) CHECK_FN(__VA_ARGS__, CHECK2, check1, dummy)(__VA_ARGS__)
+
----------------
pcc wrote:
> Perhaps it would be better to support only the two-argument form via the `CHECK` macro? That would not only simplify the macro definition, but also if I look at a `check` call with a single argument, I can tell from the name that it is just a straightforward function call.
Yeah that probably makes more sense. I thought that this macro isn't that bad, but we should avoid this sort of hack.


https://reviews.llvm.org/D40915





More information about the llvm-commits mailing list