Explicitly pass ownership of the MemoryBuffer to AddNewSourceBuffer using std::unique_ptr

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216223 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
David Blaikie
2014-08-21 20:44:56 +00:00
parent fdbf61d00d
commit 95ca0fb247
12 changed files with 55 additions and 57 deletions

View File

@ -25,7 +25,7 @@ bool llvm::parseAssemblyInto(std::unique_ptr<MemoryBuffer> F, Module &M,
SMDiagnostic &Err) {
SourceMgr SM;
StringRef Buf = F->getBuffer();
SM.AddNewSourceBuffer(F.release(), SMLoc());
SM.AddNewSourceBuffer(std::move(F), SMLoc());
return LLParser(Buf, SM, Err, &M).Run();
}