[PATCH] D31492: Add `addReplacement` interface in AtomicChange.
Haojian Wu via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Thu Mar 30 02:20:27 PDT 2017
hokein created this revision.
Herald added a subscriber: klimek.
https://reviews.llvm.org/D31492
Files:
include/clang/Tooling/Refactoring/AtomicChange.h
lib/Tooling/Refactoring/AtomicChange.cpp
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())
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.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D31492.93455.patch
Type: text/x-patch
Size: 1176 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20170330/f620b547/attachment.bin>
More information about the cfe-commits
mailing list