X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=lib%2FObject%2FArchive.cpp;h=45156f1311e9fbe987afd73d81c4e2854b659162;hb=6b863256e442f8d1df4dcbd1325ad132380de828;hp=6d09bdbac06ed0d4eafdc00e27b47c1d1cd71409;hpb=d2ae11527af77939ccbdc3f2d1b862ccc5d1fc23;p=oota-llvm.git diff --git a/lib/Object/Archive.cpp b/lib/Object/Archive.cpp index 6d09bdbac06..45156f1311e 100644 --- a/lib/Object/Archive.cpp +++ b/lib/Object/Archive.cpp @@ -177,21 +177,20 @@ Archive::Child::getMemoryBuffer(bool FullPath) const { ErrorOr> Archive::Child::getAsBinary(LLVMContext *Context) const { - std::unique_ptr ret; ErrorOr> BuffOrErr = getMemoryBuffer(); if (std::error_code EC = BuffOrErr.getError()) return EC; - std::unique_ptr Buff(BuffOrErr.get().release()); - return createBinary(Buff, Context); + return createBinary(std::move(*BuffOrErr), Context); } -ErrorOr Archive::create(std::unique_ptr Source) { +ErrorOr> +Archive::create(std::unique_ptr Source) { std::error_code EC; std::unique_ptr Ret(new Archive(std::move(Source), EC)); if (EC) return EC; - return Ret.release(); + return std::move(Ret); } Archive::Archive(std::unique_ptr Source, std::error_code &ec)