Implement tooling::Replacements as a class.
authorEric Liu <ioeric@google.com>
Mon, 1 Aug 2016 10:16:37 +0000 (10:16 +0000)
committerEric Liu <ioeric@google.com>
Mon, 1 Aug 2016 10:16:37 +0000 (10:16 +0000)
commit40ef2fb363bcd89cb4a88157f5fa97a38d795a1f
tree0817f1606ccb51b55370c8b10346d519be9aec97
parent5c9583981b5e73ac42d224ec97bd8470a384da26
Implement tooling::Replacements as a class.

Summary:
- Implement clang::tooling::Replacements as a class to provide interfaces to
  control how replacements for a single file are combined and provide guarantee
  on the order of replacements being applied.
- tooling::Replacements only contains replacements for the same file now.
  Use std::map<std::string, tooling::Replacements> to represent multi-file
  replacements.
- Error handling for the interface change will be improved in followup patches.

Reviewers: djasper, klimek

Subscribers: cfe-commits

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

llvm-svn: 277335
15 files changed:
clang/include/clang/Tooling/Core/Replacement.h
clang/include/clang/Tooling/Refactoring.h
clang/lib/Format/Format.cpp
clang/lib/Format/SortJavaScriptImports.cpp
clang/lib/Format/TokenAnalyzer.cpp
clang/lib/Format/WhitespaceManager.cpp
clang/lib/Tooling/Core/Replacement.cpp
clang/lib/Tooling/Refactoring.cpp
clang/lib/Tooling/RefactoringCallbacks.cpp
clang/tools/clang-format/ClangFormat.cpp
clang/unittests/Format/CleanupTest.cpp
clang/unittests/Format/FormatTest.cpp
clang/unittests/Tooling/RefactoringTest.cpp
clang/unittests/Tooling/ReplacementTest.h [new file with mode: 0644]
clang/unittests/Tooling/RewriterTest.cpp