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

@ -88,10 +88,9 @@ int TableGenMain(char *argv0, TableGenMainFn *MainFn) {
<< "': " << EC.message() << "\n";
return 1;
}
MemoryBuffer *F = FileOrErr.get().release();
// Tell SrcMgr about this buffer, which is what TGParser will pick up.
SrcMgr.AddNewSourceBuffer(F, SMLoc());
SrcMgr.AddNewSourceBuffer(std::move(*FileOrErr), SMLoc());
// Record the location of the include directory so that the lexer can find
// it later.