diff options
author | Fariborz Jahanian <fjahanian@apple.com> | 2013-07-08 21:42:08 +0000 |
---|---|---|
committer | Fariborz Jahanian <fjahanian@apple.com> | 2013-07-08 21:42:08 +0000 |
commit | 1921b58a2aba4f5073d6634d476356b6a4ff8815 (patch) | |
tree | 920047bba591332b5769547b6550591355ba9cda /include | |
parent | 09bddcf8c0ce4cc2f2a18e050e971539e8a396f8 (diff) | |
download | clang-1921b58a2aba4f5073d6634d476356b6a4ff8815.tar.gz |
[Objective-C migrator] replace candidate user setter/getter with
their equivalent property declaration. wip.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185873 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r-- | include/clang/Edit/Commit.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/include/clang/Edit/Commit.h b/include/clang/Edit/Commit.h index 2a296421d3..0ff7034ba0 100644 --- a/include/clang/Edit/Commit.h +++ b/include/clang/Edit/Commit.h @@ -13,6 +13,7 @@ #include "clang/Edit/FileOffset.h" #include "llvm/ADT/SmallVector.h" #include "llvm/ADT/StringRef.h" +#include "llvm/Support/Allocator.h" namespace clang { class LangOptions; @@ -51,6 +52,8 @@ private: bool IsCommitable; SmallVector<Edit, 8> CachedEdits; + + llvm::BumpPtrAllocator StrAlloc; public: explicit Commit(EditedSource &Editor); @@ -131,6 +134,12 @@ private: SourceLocation *MacroBegin = 0) const; bool isAtEndOfMacroExpansion(SourceLocation loc, SourceLocation *MacroEnd = 0) const; + + StringRef copyString(StringRef str) { + char *buf = StrAlloc.Allocate<char>(str.size()); + std::memcpy(buf, str.data(), str.size()); + return StringRef(buf, str.size()); + } }; } |