mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-13 20:32:21 +00:00
unique_ptrify MachOUniversalBinary::create
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@217052 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
b89304eb7c
commit
413eadfac9
@ -85,7 +85,8 @@ public:
|
||||
};
|
||||
|
||||
MachOUniversalBinary(MemoryBufferRef Souce, std::error_code &EC);
|
||||
static ErrorOr<MachOUniversalBinary *> create(MemoryBufferRef Source);
|
||||
static ErrorOr<std::unique_ptr<MachOUniversalBinary>>
|
||||
create(MemoryBufferRef Source);
|
||||
|
||||
object_iterator begin_objects() const {
|
||||
return ObjectForArch(this, 0);
|
||||
|
@ -63,8 +63,7 @@ ErrorOr<std::unique_ptr<Binary>> object::createBinary(MemoryBufferRef Buffer,
|
||||
case sys::fs::file_magic::bitcode:
|
||||
return ObjectFile::createSymbolicFile(Buffer, Type, Context);
|
||||
case sys::fs::file_magic::macho_universal_binary:
|
||||
return ErrorOr<std::unique_ptr<Binary>>(
|
||||
MachOUniversalBinary::create(Buffer));
|
||||
return MachOUniversalBinary::create(Buffer);
|
||||
case sys::fs::file_magic::unknown:
|
||||
case sys::fs::file_magic::windows_resource:
|
||||
// Unrecognized object file format.
|
||||
|
@ -97,14 +97,14 @@ std::error_code MachOUniversalBinary::ObjectForArch::getAsArchive(
|
||||
|
||||
void MachOUniversalBinary::anchor() { }
|
||||
|
||||
ErrorOr<MachOUniversalBinary *>
|
||||
ErrorOr<std::unique_ptr<MachOUniversalBinary>>
|
||||
MachOUniversalBinary::create(MemoryBufferRef Source) {
|
||||
std::error_code EC;
|
||||
std::unique_ptr<MachOUniversalBinary> Ret(
|
||||
new MachOUniversalBinary(Source, EC));
|
||||
if (EC)
|
||||
return EC;
|
||||
return Ret.release();
|
||||
return std::move(Ret);
|
||||
}
|
||||
|
||||
MachOUniversalBinary::MachOUniversalBinary(MemoryBufferRef Source,
|
||||
|
Loading…
Reference in New Issue
Block a user