Index: include/clang/Tooling/Refactoring/AtomicChange.h =================================================================== --- include/clang/Tooling/Refactoring/AtomicChange.h +++ include/clang/Tooling/Refactoring/AtomicChange.h @@ -70,6 +70,9 @@ /// \brief Returns the error message or an empty string if it does not exist. const std::string &getError() const { return Error; } + /// \brief Adds a replacement to the atomic change. + llvm::Error addReplacement(const Replacement& R); + /// \brief Adds a replacement that replaces range [Loc, Loc+Length) with /// \p Text. /// \returns An llvm::Error carrying ReplacementError on error. Index: lib/Tooling/Refactoring/AtomicChange.cpp =================================================================== --- lib/Tooling/Refactoring/AtomicChange.cpp +++ lib/Tooling/Refactoring/AtomicChange.cpp @@ -132,6 +132,10 @@ return E; } +llvm::Error AtomicChange::addReplacement(const Replacement& R) { + return Replaces.add(R); +} + llvm::Error AtomicChange::insert(const SourceManager &SM, SourceLocation Loc, llvm::StringRef Text, bool InsertAfter) { if (Text.empty())