r282583 - Trying to buildbot failures caused by r282577.

Eric Liu via cfe-commits cfe-commits at lists.llvm.org
Wed Sep 28 05:49:15 PDT 2016


Author: ioeric
Date: Wed Sep 28 07:49:14 2016
New Revision: 282583

URL: http://llvm.org/viewvc/llvm-project?rev=282583&view=rev
Log:
Trying to buildbot failures caused by r282577.

Modified:
    cfe/trunk/lib/Tooling/Core/Replacement.cpp

Modified: cfe/trunk/lib/Tooling/Core/Replacement.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Tooling/Core/Replacement.cpp?rev=282583&r1=282582&r2=282583&view=diff
==============================================================================
--- cfe/trunk/lib/Tooling/Core/Replacement.cpp (original)
+++ cfe/trunk/lib/Tooling/Core/Replacement.cpp Wed Sep 28 07:49:14 2016
@@ -287,8 +287,13 @@ llvm::Error Replacements::add(const Repl
     // with them and replace them with the merged replacements.
     auto MergeBegin = I;
     auto MergeEnd = std::next(I);
-    while (I-- != Replaces.begin() && Overlap(R, *I))
+    while (I != Replaces.begin()) {
+      --I;
+      // If `I` doesn't overlap with `R`, don't merge it.
+      if (!Overlap(R, *I))
+        break;
       MergeBegin = I;
+    }
     Replacements OverlapReplaces(MergeBegin, MergeEnd);
     llvm::Expected<Replacements> Merged =
         OverlapReplaces.mergeIfOrderIndependent(R);




More information about the cfe-commits mailing list