projects
/
platform
/
upstream
/
llvm.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
b358783
)
Trying to buildbot failures caused by r282577.
author
Eric Liu
<ioeric@google.com>
Wed, 28 Sep 2016 12:49:14 +0000
(12:49 +0000)
committer
Eric Liu
<ioeric@google.com>
Wed, 28 Sep 2016 12:49:14 +0000
(12:49 +0000)
llvm-svn: 282583
clang/lib/Tooling/Core/Replacement.cpp
patch
|
blob
|
history
diff --git
a/clang/lib/Tooling/Core/Replacement.cpp
b/clang/lib/Tooling/Core/Replacement.cpp
index
9184883
..
7a5fb85
100644
(file)
--- a/
clang/lib/Tooling/Core/Replacement.cpp
+++ b/
clang/lib/Tooling/Core/Replacement.cpp
@@
-287,8
+287,13
@@
llvm::Error Replacements::add(const Replacement &R) {
// 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);