[PATCH] clang-tidy: check for repeated side effects in macro

Alexander Kornienko alexfh at google.com
Wed Jun 17 05:31:05 PDT 2015


================
Comment at: clang-tidy/misc/MacroRepeatedSideEffectsCheck.cpp:70
@@ +69,3 @@
+
+    if (!HasSideEffects(ResultArgToks))
+      continue;
----------------
alexfh wrote:
> nit: And now I'd revert the order of checks (HasSideEffects seems to be slightly cheaper?) and make this even simpler:
> 
>   if (HasSideEffects(ResultArgToks) && CountArgumentExpansions(MI, Arg) >= 2) {
>     Check.diag(...) ...
>   }
... reverse the order of checks ...

http://reviews.llvm.org/D9496

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/






More information about the cfe-commits mailing list