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

Manuel Klimek via cfe-commits cfe-commits at lists.llvm.org
Wed Oct 14 04:54:32 PDT 2015


klimek added inline comments.

================
Comment at: clang-tidy/ClangTidyDiagnosticConsumer.cpp:495-496
@@ +494,4 @@
+  std::vector<bool> Apply(NumErrors, true);
+  for (int I = 0; I < NumErrors; ++I) {
+    for (int J = I + 1; J < NumErrors; ++J) {
+      OverlappingKind Kind =
----------------
I'm somewhat concerned about the quadratic runtime here, for cases where somebody messes up a {} pair in a header and we have 1000s of errors.
Can we do a two step algorithm:
- go over all error-lists, compute bounding rectangles for each
- sort errors
- only do the squared algorithm for errors where the bounding rectangles overlap


http://reviews.llvm.org/D13516





More information about the cfe-commits mailing list