diff options
author | Rafael Espindola <rafael.espindola@gmail.com> | 2014-08-27 20:03:29 +0000 |
---|---|---|
committer | Rafael Espindola <rafael.espindola@gmail.com> | 2014-08-27 20:03:29 +0000 |
commit | d92e74d96edff4e4c92ce94a71d7c2fbcd24d522 (patch) | |
tree | 093022e6d6743dba3d4afef0e5285874fee12752 /lib/Tooling/Refactoring.cpp | |
parent | 634004179fb9784061cb0407b4eac0eebbb86fcd (diff) |
Update for LLVM api change.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@216585 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Tooling/Refactoring.cpp')
-rw-r--r-- | lib/Tooling/Refactoring.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/Tooling/Refactoring.cpp b/lib/Tooling/Refactoring.cpp index c96b8c92a9..ab16dfd35f 100644 --- a/lib/Tooling/Refactoring.cpp +++ b/lib/Tooling/Refactoring.cpp @@ -182,10 +182,11 @@ std::string applyAllReplacements(StringRef Code, const Replacements &Replaces) { llvm::outs(), &Diagnostics.getDiagnosticOptions())); SourceManager SourceMgr(Diagnostics, Files); Rewriter Rewrite(SourceMgr, LangOptions()); - llvm::MemoryBuffer *Buf = llvm::MemoryBuffer::getMemBuffer(Code, "<stdin>"); + std::unique_ptr<llvm::MemoryBuffer> Buf = + llvm::MemoryBuffer::getMemBuffer(Code, "<stdin>"); const clang::FileEntry *Entry = Files.getVirtualFile("<stdin>", Buf->getBufferSize(), 0); - SourceMgr.overrideFileContents(Entry, Buf); + SourceMgr.overrideFileContents(Entry, Buf.release()); FileID ID = SourceMgr.createFileID(Entry, SourceLocation(), clang::SrcMgr::C_User); for (Replacements::const_iterator I = Replaces.begin(), E = Replaces.end(); |