mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-22 10:42:39 +01:00
unique_ptrify MachOUniversalBinary::create
llvm-svn: 217052
This commit is contained in:
parent
fbe1366788
commit
a84a0ee1dc
@ -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