From 49cc3181a264ee03eb680b03b80a01a812b2b9e9 Mon Sep 17 00:00:00 2001 From: David Blaikie Date: Wed, 27 Aug 2014 20:54:45 +0000 Subject: 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 --- clang/lib/Index/SimpleFormatContext.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'clang/lib/Index/SimpleFormatContext.h') diff --git a/clang/lib/Index/SimpleFormatContext.h b/clang/lib/Index/SimpleFormatContext.h index faf865786a5..080a4ad04dd 100644 --- a/clang/lib/Index/SimpleFormatContext.h +++ b/clang/lib/Index/SimpleFormatContext.h @@ -51,7 +51,7 @@ public: llvm::MemoryBuffer::getMemBuffer(Content); const FileEntry *Entry = Files.getVirtualFile(Name, Source->getBufferSize(), 0); - Sources.overrideFileContents(Entry, Source.release()); + Sources.overrideFileContents(Entry, std::move(Source)); assert(Entry != nullptr); return Sources.createFileID(Entry, SourceLocation(), SrcMgr::C_User); } -- cgit v1.2.3