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

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


Looks good now with one nit.

Thank you for another awesome check!


================
Comment at: clang-tidy/misc/MacroRepeatedSideEffectsCheck.cpp:70
@@ +69,3 @@
+
+    if (!HasSideEffects(ResultArgToks))
+      continue;
----------------
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(...) ...
  }

http://reviews.llvm.org/D9496

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






More information about the cfe-commits mailing list