Deduplicate replacements from diagnostics.
authorEric Liu <ioeric@google.com>
Tue, 25 Sep 2018 08:24:07 +0000 (08:24 +0000)
committerEric Liu <ioeric@google.com>
Tue, 25 Sep 2018 08:24:07 +0000 (08:24 +0000)
commit25b689ee11e47b7a0c5146b824cd682bec298195
tree696c9f3912eab93dc382260a6b57cbf6789741fc
parentb5305be6994f294288b6318832eb67d6d5bc32c9
Deduplicate replacements from diagnostics.

Summary:
After r329813, clang-apply-replacements stopped deduplicating identical
replacements; however, tools like clang-tidy relies on the deduplication of
identical dignostics replacements from different TUs to apply fixes correctly.

This change partially roll back the behavior by deduplicating changes from
diagnostics. Ideally, we should deduplicate on diagnostics level, but we need to
figure out an effecient way.

Reviewers: bkramer

Subscribers: cfe-commits

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

llvm-svn: 342951
clang-tools-extra/clang-apply-replacements/lib/Tooling/ApplyReplacements.cpp
clang-tools-extra/test/clang-apply-replacements/Inputs/identical/file1.yaml
clang-tools-extra/test/clang-apply-replacements/Inputs/identical/file2.yaml [new file with mode: 0644]
clang-tools-extra/test/clang-apply-replacements/Inputs/identical/identical.cpp
clang-tools-extra/test/clang-apply-replacements/identical.cpp