diff options
author | Fangrui Song <i@maskray.me> | 2022-12-04 09:11:11 +0000 |
---|---|---|
committer | Fangrui Song <i@maskray.me> | 2022-12-04 09:11:11 +0000 |
commit | c302fb5cc3118ba05fc4d824f4c358af16732f96 (patch) | |
tree | bf2b77c0182355876eea09a1495847c39d245831 /llvm/lib/Object/ELFObjectFile.cpp | |
parent | 5f5b942823474e98e43a27d515a87ce140396c53 (diff) | |
download | llvm-c302fb5cc3118ba05fc4d824f4c358af16732f96.zip llvm-c302fb5cc3118ba05fc4d824f4c358af16732f96.tar.gz llvm-c302fb5cc3118ba05fc4d824f4c358af16732f96.tar.bz2 |
[Object] llvm::Optional => std::optional
Diffstat (limited to 'llvm/lib/Object/ELFObjectFile.cpp')
-rw-r--r-- | llvm/lib/Object/ELFObjectFile.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/llvm/lib/Object/ELFObjectFile.cpp b/llvm/lib/Object/ELFObjectFile.cpp index ef236b8..a3593eae 100644 --- a/llvm/lib/Object/ELFObjectFile.cpp +++ b/llvm/lib/Object/ELFObjectFile.cpp @@ -376,7 +376,7 @@ SubtargetFeatures ELFObjectFileBase::getFeatures() const { } } -Optional<StringRef> ELFObjectFileBase::tryGetCPUName() const { +std::optional<StringRef> ELFObjectFileBase::tryGetCPUName() const { switch (getEMachine()) { case ELF::EM_AMDGPU: return getAMDGPUCPUName(); @@ -619,7 +619,7 @@ void ELFObjectFileBase::setARMSubArch(Triple &TheTriple) const { TheTriple.setArchName(Triple); } -std::vector<std::pair<Optional<DataRefImpl>, uint64_t>> +std::vector<std::pair<std::optional<DataRefImpl>, uint64_t>> ELFObjectFileBase::getPltAddresses() const { std::string Err; const auto Triple = makeTriple(); @@ -678,7 +678,7 @@ ELFObjectFileBase::getPltAddresses() const { GotToPlt.insert(std::make_pair(Entry.second, Entry.first)); // Find the relocations in the dynamic relocation table that point to // locations in the GOT for which we know the corresponding PLT entry. - std::vector<std::pair<Optional<DataRefImpl>, uint64_t>> Result; + std::vector<std::pair<std::optional<DataRefImpl>, uint64_t>> Result; for (const auto &Relocation : RelaPlt->relocations()) { if (Relocation.getType() != JumpSlotReloc) continue; @@ -696,7 +696,7 @@ ELFObjectFileBase::getPltAddresses() const { template <class ELFT> Expected<std::vector<BBAddrMap>> static readBBAddrMapImpl( - const ELFFile<ELFT> &EF, Optional<unsigned> TextSectionIndex) { + const ELFFile<ELFT> &EF, std::optional<unsigned> TextSectionIndex) { using Elf_Shdr = typename ELFT::Shdr; std::vector<BBAddrMap> BBAddrMaps; const auto &Sections = cantFail(EF.sections()); @@ -743,7 +743,7 @@ readDynsymVersionsImpl(const ELFFile<ELFT> &EF, if (!VerSec) return std::vector<VersionEntry>(); - Expected<SmallVector<Optional<VersionEntry>, 0>> MapOrErr = + Expected<SmallVector<std::optional<VersionEntry>, 0>> MapOrErr = EF.loadVersionMap(VerNeedSec, VerDefSec); if (!MapOrErr) return MapOrErr.takeError(); @@ -792,8 +792,8 @@ ELFObjectFileBase::readDynsymVersions() const { Symbols); } -Expected<std::vector<BBAddrMap>> -ELFObjectFileBase::readBBAddrMap(Optional<unsigned> TextSectionIndex) const { +Expected<std::vector<BBAddrMap>> ELFObjectFileBase::readBBAddrMap( + std::optional<unsigned> TextSectionIndex) const { if (const auto *Obj = dyn_cast<ELF32LEObjectFile>(this)) return readBBAddrMapImpl(Obj->getELFFile(), TextSectionIndex); if (const auto *Obj = dyn_cast<ELF64LEObjectFile>(this)) |