mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-11-02 07:11:49 +00:00
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:
parent
79002da926
commit
1c9b9823da
@ -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,
|
||||
|
@ -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)
|
||||
|
@ -88,10 +88,11 @@ std::error_code MachOUniversalBinary::ObjectForArch::getAsArchive(
|
||||
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;
|
||||
|
Loading…
Reference in New Issue
Block a user