diff options
Diffstat (limited to 'llvm/lib/Object/MachOObjectFile.cpp')
-rw-r--r-- | llvm/lib/Object/MachOObjectFile.cpp | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/llvm/lib/Object/MachOObjectFile.cpp b/llvm/lib/Object/MachOObjectFile.cpp index 8fa3f67..46ed3b2 100644 --- a/llvm/lib/Object/MachOObjectFile.cpp +++ b/llvm/lib/Object/MachOObjectFile.cpp @@ -4906,12 +4906,12 @@ MachOObjectFile::getLinkOptHintsLoadCommand() const { ArrayRef<uint8_t> MachOObjectFile::getDyldInfoRebaseOpcodes() const { if (!DyldInfoLoadCmd) - return std::nullopt; + return {}; auto DyldInfoOrErr = getStructOrErr<MachO::dyld_info_command>(*this, DyldInfoLoadCmd); if (!DyldInfoOrErr) - return std::nullopt; + return {}; MachO::dyld_info_command DyldInfo = DyldInfoOrErr.get(); const uint8_t *Ptr = reinterpret_cast<const uint8_t *>(getPtr(*this, DyldInfo.rebase_off)); @@ -4920,12 +4920,12 @@ ArrayRef<uint8_t> MachOObjectFile::getDyldInfoRebaseOpcodes() const { ArrayRef<uint8_t> MachOObjectFile::getDyldInfoBindOpcodes() const { if (!DyldInfoLoadCmd) - return std::nullopt; + return {}; auto DyldInfoOrErr = getStructOrErr<MachO::dyld_info_command>(*this, DyldInfoLoadCmd); if (!DyldInfoOrErr) - return std::nullopt; + return {}; MachO::dyld_info_command DyldInfo = DyldInfoOrErr.get(); const uint8_t *Ptr = reinterpret_cast<const uint8_t *>(getPtr(*this, DyldInfo.bind_off)); @@ -4934,12 +4934,12 @@ ArrayRef<uint8_t> MachOObjectFile::getDyldInfoBindOpcodes() const { ArrayRef<uint8_t> MachOObjectFile::getDyldInfoWeakBindOpcodes() const { if (!DyldInfoLoadCmd) - return std::nullopt; + return {}; auto DyldInfoOrErr = getStructOrErr<MachO::dyld_info_command>(*this, DyldInfoLoadCmd); if (!DyldInfoOrErr) - return std::nullopt; + return {}; MachO::dyld_info_command DyldInfo = DyldInfoOrErr.get(); const uint8_t *Ptr = reinterpret_cast<const uint8_t *>(getPtr(*this, DyldInfo.weak_bind_off)); @@ -4948,12 +4948,12 @@ ArrayRef<uint8_t> MachOObjectFile::getDyldInfoWeakBindOpcodes() const { ArrayRef<uint8_t> MachOObjectFile::getDyldInfoLazyBindOpcodes() const { if (!DyldInfoLoadCmd) - return std::nullopt; + return {}; auto DyldInfoOrErr = getStructOrErr<MachO::dyld_info_command>(*this, DyldInfoLoadCmd); if (!DyldInfoOrErr) - return std::nullopt; + return {}; MachO::dyld_info_command DyldInfo = DyldInfoOrErr.get(); const uint8_t *Ptr = reinterpret_cast<const uint8_t *>(getPtr(*this, DyldInfo.lazy_bind_off)); @@ -4962,12 +4962,12 @@ ArrayRef<uint8_t> MachOObjectFile::getDyldInfoLazyBindOpcodes() const { ArrayRef<uint8_t> MachOObjectFile::getDyldInfoExportsTrie() const { if (!DyldInfoLoadCmd) - return std::nullopt; + return {}; auto DyldInfoOrErr = getStructOrErr<MachO::dyld_info_command>(*this, DyldInfoLoadCmd); if (!DyldInfoOrErr) - return std::nullopt; + return {}; MachO::dyld_info_command DyldInfo = DyldInfoOrErr.get(); const uint8_t *Ptr = reinterpret_cast<const uint8_t *>(getPtr(*this, DyldInfo.export_off)); @@ -5248,12 +5248,12 @@ MachOObjectFile::getDyldChainedFixupTargets() const { ArrayRef<uint8_t> MachOObjectFile::getDyldExportsTrie() const { if (!DyldExportsTrieLoadCmd) - return std::nullopt; + return {}; auto DyldExportsTrieOrError = getStructOrErr<MachO::linkedit_data_command>( *this, DyldExportsTrieLoadCmd); if (!DyldExportsTrieOrError) - return std::nullopt; + return {}; MachO::linkedit_data_command DyldExportsTrie = DyldExportsTrieOrError.get(); const uint8_t *Ptr = reinterpret_cast<const uint8_t *>(getPtr(*this, DyldExportsTrie.dataoff)); @@ -5277,7 +5277,7 @@ SmallVector<uint64_t> MachOObjectFile::getFunctionStarts() const { ArrayRef<uint8_t> MachOObjectFile::getUuid() const { if (!UuidLoadCmd) - return std::nullopt; + return {}; // Returning a pointer is fine as uuid doesn't need endian swapping. const char *Ptr = UuidLoadCmd + offsetof(MachO::uuid_command, uuid); return ArrayRef(reinterpret_cast<const uint8_t *>(Ptr), 16); |