]> granicus.if.org Git - clang/commit
Merge conflicting replacements when they are order-independent.
authorEric Liu <ioeric@google.com>
Wed, 28 Sep 2016 11:02:16 +0000 (11:02 +0000)
committerEric Liu <ioeric@google.com>
Wed, 28 Sep 2016 11:02:16 +0000 (11:02 +0000)
commit7fc60d9e117f4e7f3767089067d3e947f76801ae
treefa3632df77ae959e0fd964ea7e3f599d83db4715
parent9fecde6a33e3cf51e7b122ab72ec0a499a6a765b
Merge conflicting replacements when they are order-independent.

Summary:
Now two replacements are considered order-independent if applying them in
either order produces the same result. These include (but not restricted
to) replacements that:
  - don't overlap (being directly adjacent is fine) and
  - are overlapping deletions.
  - are insertions at the same offset and applying them in either order
    has the same effect, i.e. X + Y = Y + X if one inserts text X and the
    other inserts text Y.

Discussion about this design can be found in D24717

Reviewers: djasper, klimek

Subscribers: omtcyfz, cfe-commits

Differential Revision: https://reviews.llvm.org/D24800

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@282577 91177308-0d34-0410-b5e6-96231b3b80d8
include/clang/Tooling/Core/Replacement.h
lib/Tooling/Core/Replacement.cpp
unittests/Tooling/RefactoringTest.cpp