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

Rafael Avila de Espindola via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 6 13:52:39 PST 2017


Peter Collingbourne via Phabricator <reviews at reviews.llvm.org> writes:

> pcc added inline comments.
>
>
> ================
> Comment at: lld/include/lld/Common/ErrorHandler.h:116
> +
> +#define CHECK(...) CHECK_FN(__VA_ARGS__, CHECK2, check1, dummy)(__VA_ARGS__)
> +
> ----------------
> 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.

I agree. Macros are very uncommon in llvm/lld, so having just the case
that needs to be a macro be one is an improvement.

Cheers,
Rafael


More information about the llvm-commits mailing list