diff options
author | David Blaikie <dblaikie@gmail.com> | 2014-08-27 20:54:45 +0000 |
---|---|---|
committer | David Blaikie <dblaikie@gmail.com> | 2014-08-27 20:54:45 +0000 |
commit | 49cc3181a264ee03eb680b03b80a01a812b2b9e9 (patch) | |
tree | b4c751e431dbd1e56fba597b1ee59052f1f643c0 /clang/lib/Tooling/Refactoring.cpp | |
parent | 833bc681e32b5aba400ed47ad4da27686d86ce19 (diff) | |
download | bcm5719-llvm-49cc3181a264ee03eb680b03b80a01a812b2b9e9.tar.gz bcm5719-llvm-49cc3181a264ee03eb680b03b80a01a812b2b9e9.zip |
Overload SourceManager::overrideFileContents so that unconditionally passing ownership is explicitly done using unique_ptr.
Only those callers who are dynamically passing ownership should need the
3 argument form. Those accepting the default ("do pass ownership")
should do so explicitly with a unique_ptr now.
llvm-svn: 216614
Diffstat (limited to 'clang/lib/Tooling/Refactoring.cpp')
-rw-r--r-- | clang/lib/Tooling/Refactoring.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/lib/Tooling/Refactoring.cpp b/clang/lib/Tooling/Refactoring.cpp index ab16dfd35f8..b2a02cb0964 100644 --- a/clang/lib/Tooling/Refactoring.cpp +++ b/clang/lib/Tooling/Refactoring.cpp @@ -186,7 +186,7 @@ std::string applyAllReplacements(StringRef Code, const Replacements &Replaces) { llvm::MemoryBuffer::getMemBuffer(Code, "<stdin>"); const clang::FileEntry *Entry = Files.getVirtualFile("<stdin>", Buf->getBufferSize(), 0); - SourceMgr.overrideFileContents(Entry, Buf.release()); + SourceMgr.overrideFileContents(Entry, std::move(Buf)); FileID ID = SourceMgr.createFileID(Entry, SourceLocation(), clang::SrcMgr::C_User); for (Replacements::const_iterator I = Replaces.begin(), E = Replaces.end(); |