Replace llvm::OwningPtr with std::unique_ptr

It looks like llvm::OwningPtr is going to be removed soon.


Swift SVN r14729
This commit is contained in:
Dmitri Hrybenko
2014-03-06 09:47:17 +00:00
parent 07cb1c935a
commit f232267f23
16 changed files with 52 additions and 81 deletions

View File

@@ -184,7 +184,7 @@ bool swift::CompilerInstance::setup(const CompilerInvocation &Invok) {
}
// Open the input file.
llvm::OwningPtr<llvm::MemoryBuffer> InputFile;
std::unique_ptr<llvm::MemoryBuffer> InputFile;
if (llvm::error_code Err =
llvm::MemoryBuffer::getFileOrSTDIN(File, InputFile)) {
Diagnostics.diagnose(SourceLoc(), diag::error_open_input_file,
@@ -192,7 +192,7 @@ bool swift::CompilerInstance::setup(const CompilerInvocation &Invok) {
return true;
}
unsigned BufferID = SourceMgr.addNewSourceBuffer(InputFile.take());
unsigned BufferID = SourceMgr.addNewSourceBuffer(std::move(InputFile));
// Transfer ownership of the MemoryBuffer to the SourceMgr.
BufferIDs.push_back(BufferID);