A std::unique_ptr case I missed in the previous patch.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@214379 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Rafael Espindola
2014-07-31 03:36:00 +00:00
parent 79002da926
commit 1c9b9823da
3 changed files with 8 additions and 5 deletions

View File

@ -184,12 +184,13 @@ Archive::Child::getAsBinary(LLVMContext *Context) const {
return createBinary(std::move(*BuffOrErr), Context);
}
ErrorOr<Archive *> Archive::create(std::unique_ptr<MemoryBuffer> Source) {
ErrorOr<std::unique_ptr<Archive>>
Archive::create(std::unique_ptr<MemoryBuffer> Source) {
std::error_code EC;
std::unique_ptr<Archive> Ret(new Archive(std::move(Source), EC));
if (EC)
return EC;
return Ret.release();
return std::move(Ret);
}
Archive::Archive(std::unique_ptr<MemoryBuffer> Source, std::error_code &ec)