summaryrefslogtreecommitdiffstats
path: root/include/clang/Edit
diff options
context:
space:
mode:
authorBenjamin Kramer <benny.kra@googlemail.com>2015-08-04 11:18:09 +0000
committerBenjamin Kramer <benny.kra@googlemail.com>2015-08-04 11:18:09 +0000
commit12e7db288637915b205aa7216ad5dc4d5224c638 (patch)
tree9acff6fab48b348eb2ec944b3db0d13482f88ed7 /include/clang/Edit
parent93d1180ecc880f59f1d44ed4fd56b48d36d2e516 (diff)
[Edit] Use StringRef's copy method. No functional change intended.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@243968 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang/Edit')
-rw-r--r--include/clang/Edit/Commit.h6
-rw-r--r--include/clang/Edit/EditedSource.h6
2 files changed, 1 insertions, 11 deletions
diff --git a/include/clang/Edit/Commit.h b/include/clang/Edit/Commit.h
index 5cc5b9c6ff..ac4bb471fe 100644
--- a/include/clang/Edit/Commit.h
+++ b/include/clang/Edit/Commit.h
@@ -134,12 +134,6 @@ private:
SourceLocation *MacroBegin = nullptr) const;
bool isAtEndOfMacroExpansion(SourceLocation loc,
SourceLocation *MacroEnd = nullptr) const;
-
- StringRef copyString(StringRef str) {
- char *buf = StrAlloc.Allocate<char>(str.size());
- std::memcpy(buf, str.data(), str.size());
- return StringRef(buf, str.size());
- }
};
}
diff --git a/include/clang/Edit/EditedSource.h b/include/clang/Edit/EditedSource.h
index 150a5b41b5..8bc27e73be 100644
--- a/include/clang/Edit/EditedSource.h
+++ b/include/clang/Edit/EditedSource.h
@@ -62,11 +62,7 @@ public:
void applyRewrites(EditsReceiver &receiver);
void clearRewrites();
- StringRef copyString(StringRef str) {
- char *buf = StrAlloc.Allocate<char>(str.size());
- std::memcpy(buf, str.data(), str.size());
- return StringRef(buf, str.size());
- }
+ StringRef copyString(StringRef str) { return str.copy(StrAlloc); }
StringRef copyString(const Twine &twine);
private: