[PATCH] D18806: [clang-tidy] filter plugins and plugin arguments of the command-line

Alexander Kornienko via cfe-commits cfe-commits at lists.llvm.org
Wed Apr 6 06:50:08 PDT 2016


alexfh accepted this revision.
alexfh added a comment.
This revision is now accepted and ready to land.

LG in general. A few nits.


================
Comment at: clang-tidy/ClangTidy.cpp:439
@@ +438,3 @@
+    CommandLineArguments AdjustedArgs;
+    for (size_t i = 0, e = Args.size(); i != e; ++i) {
+      if (i + 4 < Args.size() &&
----------------
Variable names should start with an upper-case character. Also, I prefer `I < E` as a loop condition in case of numeric `I` and `E`.

================
Comment at: clang-tidy/ClangTidy.cpp:441
@@ +440,3 @@
+      if (i + 4 < Args.size() &&
+          Args[i + 0] == "-Xclang" &&
+          (Args[i + 1] == "-load" ||
----------------
`i + 0` confuses more than helps, please change to just `i`. 

================
Comment at: clang-tidy/ClangTidy.cpp:446
@@ +445,3 @@
+          Args[i + 2] == "-Xclang") {
+        // skip all arguments.
+        i += 3;
----------------
The comment doesn't help much. I'd just drop it.

================
Comment at: clang-tidy/ClangTidy.cpp:448
@@ +447,3 @@
+        i += 3;
+      }
+      else AdjustedArgs.push_back(Args[i + 0]);
----------------
clang-format -style=llvm (or -style=file), please.


http://reviews.llvm.org/D18806





More information about the cfe-commits mailing list