[llvm] r214379 - A std::unique_ptr case I missed in the previous patch.
Rafael Espindola
rafael.espindola at gmail.com
Wed Jul 30 20:36:00 PDT 2014
Author: rafael
Date: Wed Jul 30 22:36:00 2014
New Revision: 214379
URL: http://llvm.org/viewvc/llvm-project?rev=214379&view=rev
Log:
A std::unique_ptr case I missed in the previous patch.
Modified:
llvm/trunk/include/llvm/Object/Archive.h
llvm/trunk/lib/Object/Archive.cpp
llvm/trunk/lib/Object/MachOUniversal.cpp
Modified: llvm/trunk/include/llvm/Object/Archive.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Object/Archive.h?rev=214379&r1=214378&r2=214379&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Object/Archive.h (original)
+++ llvm/trunk/include/llvm/Object/Archive.h Wed Jul 30 22:36:00 2014
@@ -165,7 +165,8 @@ public:
};
Archive(std::unique_ptr<MemoryBuffer> Source, std::error_code &EC);
- static ErrorOr<Archive *> create(std::unique_ptr<MemoryBuffer> Source);
+ static ErrorOr<std::unique_ptr<Archive>>
+ create(std::unique_ptr<MemoryBuffer> Source);
enum Kind {
K_GNU,
Modified: llvm/trunk/lib/Object/Archive.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Object/Archive.cpp?rev=214379&r1=214378&r2=214379&view=diff
==============================================================================
--- llvm/trunk/lib/Object/Archive.cpp (original)
+++ llvm/trunk/lib/Object/Archive.cpp Wed Jul 30 22:36:00 2014
@@ -184,12 +184,13 @@ Archive::Child::getAsBinary(LLVMContext
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)
Modified: llvm/trunk/lib/Object/MachOUniversal.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Object/MachOUniversal.cpp?rev=214379&r1=214378&r2=214379&view=diff
==============================================================================
--- llvm/trunk/lib/Object/MachOUniversal.cpp (original)
+++ llvm/trunk/lib/Object/MachOUniversal.cpp Wed Jul 30 22:36:00 2014
@@ -88,10 +88,11 @@ std::error_code MachOUniversalBinary::Ob
std::string ObjectName = Parent->getFileName().str();
std::unique_ptr<MemoryBuffer> ObjBuffer(
MemoryBuffer::getMemBuffer(ObjectData, ObjectName, false));
- ErrorOr<Archive *> Obj = Archive::create(std::move(ObjBuffer));
+ ErrorOr<std::unique_ptr<Archive>> Obj =
+ Archive::create(std::move(ObjBuffer));
if (std::error_code EC = Obj.getError())
return EC;
- Result.reset(Obj.get());
+ Result = std::move(Obj.get());
return object_error::success;
}
return object_error::parse_failed;
More information about the llvm-commits
mailing list