[PATCH] D13516: Fix overlapping replacements in clang-tidy.

Manuel Klimek via cfe-commits cfe-commits at lists.llvm.org
Tue Oct 13 02:22:23 PDT 2015


klimek added inline comments.

================
Comment at: clang-tidy/ClangTidyDiagnosticConsumer.cpp:418-419
@@ +417,4 @@
+    unsigned Pos;
+    int Type;
+    int ErrorId;
+  };
----------------
These need to be documented.

================
Comment at: clang-tidy/ClangTidyDiagnosticConsumer.cpp:421
@@ +420,3 @@
+  };
+  std::priority_queue<Event> Pq;
+  for (const auto &Interval : First) {
----------------
I'd name this Queue instead (reading later I had no idea what this was).

================
Comment at: clang-tidy/ClangTidyDiagnosticConsumer.cpp:433-436
@@ +432,6 @@
+  int Count[2] = {0, 0};
+  // Sit[1][0] will tell if there exists any range that is covered by the
+  // first set but not by the second one, Sit[1][1] will tell if there is a
+  // range covered by both sets, etc.
+  bool Sit[2][2] = {{false, false}, {false, false}};
+
----------------
Why are you calling this "Sit"?

================
Comment at: clang-tidy/ClangTidyDiagnosticConsumer.cpp:475
@@ +474,3 @@
+    }
+    std::sort(Intervals.begin(), Intervals.end());
+    IntervalsList.push_back(std::move(Intervals));
----------------
Why do we need to sort?



http://reviews.llvm.org/D13516





More information about the cfe-commits mailing list