Page MenuHomePhabricator

D31492.id93455.diff
No OneTemporary

File Metadata

Created
Fri, Jan 24, 3:54 PM

D31492.id93455.diff

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())

Event Timeline