diff options
Diffstat (limited to 'llvm/lib/Object')
-rw-r--r-- | llvm/lib/Object/Archive.cpp | 2 | ||||
-rw-r--r-- | llvm/lib/Object/BuildID.cpp | 4 | ||||
-rw-r--r-- | llvm/lib/Object/ELFObjectFile.cpp | 4 | ||||
-rw-r--r-- | llvm/lib/Object/MachOObjectFile.cpp | 32 | ||||
-rw-r--r-- | llvm/lib/Object/Minidump.cpp | 2 |
5 files changed, 22 insertions, 22 deletions
diff --git a/llvm/lib/Object/Archive.cpp b/llvm/lib/Object/Archive.cpp index 6468350..f22bcf9 100644 --- a/llvm/lib/Object/Archive.cpp +++ b/llvm/lib/Object/Archive.cpp @@ -1158,7 +1158,7 @@ Expected<Optional<Archive::Child>> Archive::findSym(StringRef name) const { return MemberOrErr.takeError(); } } - return None; + return std::nullopt; } // Returns true if archive file contains no member file. diff --git a/llvm/lib/Object/BuildID.cpp b/llvm/lib/Object/BuildID.cpp index 68b6f43..2b7d3c0 100644 --- a/llvm/lib/Object/BuildID.cpp +++ b/llvm/lib/Object/BuildID.cpp @@ -54,7 +54,7 @@ Optional<BuildIDRef> getBuildID(const ObjectFile *Obj) { return getBuildID(O->getELFFile()); if (auto *O = dyn_cast<ELFObjectFile<ELF64BE>>(Obj)) return getBuildID(O->getELFFile()); - return None; + return std::nullopt; } Optional<std::string> BuildIDFetcher::fetch(BuildIDRef BuildID) const { @@ -86,7 +86,7 @@ Optional<std::string> BuildIDFetcher::fetch(BuildIDRef BuildID) const { return std::string(Path); } } - return None; + return std::nullopt; } } // namespace object diff --git a/llvm/lib/Object/ELFObjectFile.cpp b/llvm/lib/Object/ELFObjectFile.cpp index 31f0090..ef236b8 100644 --- a/llvm/lib/Object/ELFObjectFile.cpp +++ b/llvm/lib/Object/ELFObjectFile.cpp @@ -383,7 +383,7 @@ Optional<StringRef> ELFObjectFileBase::tryGetCPUName() const { case ELF::EM_PPC64: return StringRef("future"); default: - return None; + return std::nullopt; } } @@ -686,7 +686,7 @@ ELFObjectFileBase::getPltAddresses() const { if (PltEntryIter != GotToPlt.end()) { symbol_iterator Sym = Relocation.getSymbol(); if (Sym == symbol_end()) - Result.emplace_back(None, PltEntryIter->second); + Result.emplace_back(std::nullopt, PltEntryIter->second); else Result.emplace_back(Sym->getRawDataRefImpl(), PltEntryIter->second); } diff --git a/llvm/lib/Object/MachOObjectFile.cpp b/llvm/lib/Object/MachOObjectFile.cpp index f3ca2e9..e6ff7cb 100644 --- a/llvm/lib/Object/MachOObjectFile.cpp +++ b/llvm/lib/Object/MachOObjectFile.cpp @@ -4889,12 +4889,12 @@ MachOObjectFile::getLinkOptHintsLoadCommand() const { ArrayRef<uint8_t> MachOObjectFile::getDyldInfoRebaseOpcodes() const { if (!DyldInfoLoadCmd) - return None; + return std::nullopt; auto DyldInfoOrErr = getStructOrErr<MachO::dyld_info_command>(*this, DyldInfoLoadCmd); if (!DyldInfoOrErr) - return None; + return std::nullopt; MachO::dyld_info_command DyldInfo = DyldInfoOrErr.get(); const uint8_t *Ptr = reinterpret_cast<const uint8_t *>(getPtr(*this, DyldInfo.rebase_off)); @@ -4903,12 +4903,12 @@ ArrayRef<uint8_t> MachOObjectFile::getDyldInfoRebaseOpcodes() const { ArrayRef<uint8_t> MachOObjectFile::getDyldInfoBindOpcodes() const { if (!DyldInfoLoadCmd) - return None; + return std::nullopt; auto DyldInfoOrErr = getStructOrErr<MachO::dyld_info_command>(*this, DyldInfoLoadCmd); if (!DyldInfoOrErr) - return None; + return std::nullopt; MachO::dyld_info_command DyldInfo = DyldInfoOrErr.get(); const uint8_t *Ptr = reinterpret_cast<const uint8_t *>(getPtr(*this, DyldInfo.bind_off)); @@ -4917,12 +4917,12 @@ ArrayRef<uint8_t> MachOObjectFile::getDyldInfoBindOpcodes() const { ArrayRef<uint8_t> MachOObjectFile::getDyldInfoWeakBindOpcodes() const { if (!DyldInfoLoadCmd) - return None; + return std::nullopt; auto DyldInfoOrErr = getStructOrErr<MachO::dyld_info_command>(*this, DyldInfoLoadCmd); if (!DyldInfoOrErr) - return None; + return std::nullopt; MachO::dyld_info_command DyldInfo = DyldInfoOrErr.get(); const uint8_t *Ptr = reinterpret_cast<const uint8_t *>(getPtr(*this, DyldInfo.weak_bind_off)); @@ -4931,12 +4931,12 @@ ArrayRef<uint8_t> MachOObjectFile::getDyldInfoWeakBindOpcodes() const { ArrayRef<uint8_t> MachOObjectFile::getDyldInfoLazyBindOpcodes() const { if (!DyldInfoLoadCmd) - return None; + return std::nullopt; auto DyldInfoOrErr = getStructOrErr<MachO::dyld_info_command>(*this, DyldInfoLoadCmd); if (!DyldInfoOrErr) - return None; + return std::nullopt; MachO::dyld_info_command DyldInfo = DyldInfoOrErr.get(); const uint8_t *Ptr = reinterpret_cast<const uint8_t *>(getPtr(*this, DyldInfo.lazy_bind_off)); @@ -4945,12 +4945,12 @@ ArrayRef<uint8_t> MachOObjectFile::getDyldInfoLazyBindOpcodes() const { ArrayRef<uint8_t> MachOObjectFile::getDyldInfoExportsTrie() const { if (!DyldInfoLoadCmd) - return None; + return std::nullopt; auto DyldInfoOrErr = getStructOrErr<MachO::dyld_info_command>(*this, DyldInfoLoadCmd); if (!DyldInfoOrErr) - return None; + return std::nullopt; MachO::dyld_info_command DyldInfo = DyldInfoOrErr.get(); const uint8_t *Ptr = reinterpret_cast<const uint8_t *>(getPtr(*this, DyldInfo.export_off)); @@ -4961,7 +4961,7 @@ Expected<Optional<MachO::linkedit_data_command>> MachOObjectFile::getChainedFixupsLoadCommand() const { // Load the dyld chained fixups load command. if (!DyldChainedFixupsLoadCmd) - return llvm::None; + return std::nullopt; auto DyldChainedFixupsOrErr = getStructOrErr<MachO::linkedit_data_command>( *this, DyldChainedFixupsLoadCmd); if (!DyldChainedFixupsOrErr) @@ -4972,7 +4972,7 @@ MachOObjectFile::getChainedFixupsLoadCommand() const { // If the load command is present but the data offset has been zeroed out, // as is the case for dylib stubs, return None (no error). if (!DyldChainedFixups.dataoff) - return llvm::None; + return std::nullopt; return DyldChainedFixups; } @@ -4982,7 +4982,7 @@ MachOObjectFile::getChainedFixupsHeader() const { if (!CFOrErr) return CFOrErr.takeError(); if (!CFOrErr->has_value()) - return llvm::None; + return std::nullopt; const MachO::linkedit_data_command &DyldChainedFixups = **CFOrErr; @@ -5236,12 +5236,12 @@ MachOObjectFile::getDyldChainedFixupTargets() const { ArrayRef<uint8_t> MachOObjectFile::getDyldExportsTrie() const { if (!DyldExportsTrieLoadCmd) - return None; + return std::nullopt; auto DyldExportsTrieOrError = getStructOrErr<MachO::linkedit_data_command>( *this, DyldExportsTrieLoadCmd); if (!DyldExportsTrieOrError) - return None; + return std::nullopt; MachO::linkedit_data_command DyldExportsTrie = DyldExportsTrieOrError.get(); const uint8_t *Ptr = reinterpret_cast<const uint8_t *>(getPtr(*this, DyldExportsTrie.dataoff)); @@ -5265,7 +5265,7 @@ SmallVector<uint64_t> MachOObjectFile::getFunctionStarts() const { ArrayRef<uint8_t> MachOObjectFile::getUuid() const { if (!UuidLoadCmd) - return None; + return std::nullopt; // Returning a pointer is fine as uuid doesn't need endian swapping. const char *Ptr = UuidLoadCmd + offsetof(MachO::uuid_command, uuid); return makeArrayRef(reinterpret_cast<const uint8_t *>(Ptr), 16); diff --git a/llvm/lib/Object/Minidump.cpp b/llvm/lib/Object/Minidump.cpp index 3e932fe..a1316b0 100644 --- a/llvm/lib/Object/Minidump.cpp +++ b/llvm/lib/Object/Minidump.cpp @@ -19,7 +19,7 @@ MinidumpFile::getRawStream(minidump::StreamType Type) const { auto It = StreamMap.find(Type); if (It != StreamMap.end()) return getRawStream(Streams[It->second]); - return None; + return std::nullopt; } Expected<std::string> MinidumpFile::getString(size_t Offset) const { |