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/Lex/Preprocessor.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'clang/lib/Lex/Preprocessor.cpp') diff --git a/clang/lib/Lex/Preprocessor.cpp b/clang/lib/Lex/Preprocessor.cpp index 29956c9f584..1dd46b0de9b 100644 --- a/clang/lib/Lex/Preprocessor.cpp +++ b/clang/lib/Lex/Preprocessor.cpp @@ -406,7 +406,7 @@ bool Preprocessor::SetCodeCompletionPoint(const FileEntry *File, char *NewPos = std::copy(Buffer->getBufferStart(), Position, NewBuf); *NewPos = '\0'; std::copy(Position, Buffer->getBufferEnd(), NewPos+1); - SourceMgr.overrideFileContents(File, NewBuffer.release()); + SourceMgr.overrideFileContents(File, std::move(NewBuffer)); } return false; -- cgit v1.2.3