#define LLVM_DEBUGINFOD_DIFETCHER_H
#include "llvm/Object/BuildID.h"
+#include <optional>
namespace llvm {
/// Fetches the given Build ID using debuginfod and returns a local path to
/// the resulting file.
- Optional<std::string> fetch(object::BuildIDRef BuildID) const override;
+ std::optional<std::string> fetch(object::BuildIDRef BuildID) const override;
};
} // namespace llvm
static bool classof(Binary const *v) { return v->isArchive(); }
// check if a symbol is in the archive
- Expected<Optional<Child>> findSym(StringRef name) const;
+ Expected<std::optional<Child>> findSym(StringRef name) const;
virtual bool isEmpty() const;
bool hasSymbolTable() const;
class ObjectFile;
/// Returns the build ID, if any, contained in the given object file.
-Optional<BuildIDRef> getBuildID(const ObjectFile *Obj);
+std::optional<BuildIDRef> getBuildID(const ObjectFile *Obj);
/// BuildIDFetcher searches local cache directories for debug info.
class BuildIDFetcher {
virtual ~BuildIDFetcher() = default;
/// Returns the path to the debug file with the given build ID.
- virtual Optional<std::string> fetch(BuildIDRef BuildID) const;
+ virtual std::optional<std::string> fetch(BuildIDRef BuildID) const;
private:
const std::vector<std::string> DebugFileDirectories;
MemoryBufferRef Data;
dxbc::Header Header;
SmallVector<uint32_t, 4> PartOffsets;
- Optional<DXILData> DXIL;
- Optional<uint64_t> ShaderFlags;
- Optional<dxbc::ShaderHash> Hash;
+ std::optional<DXILData> DXIL;
+ std::optional<uint64_t> ShaderFlags;
+ std::optional<dxbc::ShaderHash> Hash;
Error parseHeader();
Error parsePartOffsets();
const dxbc::Header &getHeader() const { return Header; }
- Optional<DXILData> getDXIL() const { return DXIL; }
+ std::optional<DXILData> getDXIL() const { return DXIL; }
- Optional<uint64_t> getShaderFlags() const { return ShaderFlags; }
+ std::optional<uint64_t> getShaderFlags() const { return ShaderFlags; }
- Optional<dxbc::ShaderHash> getShaderHash() const { return Hash; }
+ std::optional<dxbc::ShaderHash> getShaderHash() const { return Hash; }
};
} // namespace object
}
const T *First;
- Optional<uint64_t> Size = std::nullopt;
+ std::optional<uint64_t> Size = std::nullopt;
const uint8_t *BufEnd = nullptr;
};
Expected<std::vector<VerNeed>> getVersionDependencies(
const Elf_Shdr &Sec,
WarningHandler WarnHandler = &defaultWarningHandler) const;
- Expected<StringRef>
- getSymbolVersionByIndex(uint32_t SymbolVersionIndex, bool &IsDefault,
- SmallVector<Optional<VersionEntry>, 0> &VersionMap,
- Optional<bool> IsSymHidden) const;
+ Expected<StringRef> getSymbolVersionByIndex(
+ uint32_t SymbolVersionIndex, bool &IsDefault,
+ SmallVector<std::optional<VersionEntry>, 0> &VersionMap,
+ std::optional<bool> IsSymHidden) const;
Expected<StringRef>
getStringTable(const Elf_Shdr &Section,
Expected<const Elf_Sym *> getRelocationSymbol(const Elf_Rel &Rel,
const Elf_Shdr *SymTab) const;
- Expected<SmallVector<Optional<VersionEntry>, 0>>
+ Expected<SmallVector<std::optional<VersionEntry>, 0>>
loadVersionMap(const Elf_Shdr *VerNeedSec, const Elf_Shdr *VerDefSec) const;
static Expected<ELFFile> create(StringRef Object);
}
template <class ELFT>
-Expected<SmallVector<Optional<VersionEntry>, 0>>
+Expected<SmallVector<std::optional<VersionEntry>, 0>>
ELFFile<ELFT>::loadVersionMap(const Elf_Shdr *VerNeedSec,
const Elf_Shdr *VerDefSec) const {
- SmallVector<Optional<VersionEntry>, 0> VersionMap;
+ SmallVector<std::optional<VersionEntry>, 0> VersionMap;
// The first two version indexes are reserved.
// Index 0 is VER_NDX_LOCAL, index 1 is VER_NDX_GLOBAL.
Expected<Elf_Dyn_Range> DynTable = dynamicEntries();
if (!DynTable)
return DynTable.takeError();
- llvm::Optional<uint64_t> ElfHash;
- llvm::Optional<uint64_t> ElfGnuHash;
+ std::optional<uint64_t> ElfHash;
+ std::optional<uint64_t> ElfGnuHash;
for (const Elf_Dyn &Entry : *DynTable) {
switch (Entry.d_tag) {
case ELF::DT_HASH:
template <typename ELFT>
Expected<StringRef> ELFFile<ELFT>::getSymbolVersionByIndex(
uint32_t SymbolVersionIndex, bool &IsDefault,
- SmallVector<Optional<VersionEntry>, 0> &VersionMap,
- Optional<bool> IsSymHidden) const {
+ SmallVector<std::optional<VersionEntry>, 0> &VersionMap,
+ std::optional<bool> IsSymHidden) const {
size_t VersionIndex = SymbolVersionIndex & llvm::ELF::VERSYM_VERSION;
// Special markers for unversioned symbols.
SubtargetFeatures getFeatures() const override;
- Optional<StringRef> tryGetCPUName() const override;
+ std::optional<StringRef> tryGetCPUName() const override;
void setARMSubArch(Triple &TheTriple) const override;
virtual uint16_t getEMachine() const = 0;
- std::vector<std::pair<Optional<DataRefImpl>, uint64_t>>
+ std::vector<std::pair<std::optional<DataRefImpl>, uint64_t>>
getPltAddresses() const;
/// Returns a vector containing a symbol version for each dynamic symbol.
// `TextSectionIndex` is specified, only returns the BB address maps
// corresponding to the section with that index.
Expected<std::vector<BBAddrMap>>
- readBBAddrMap(Optional<unsigned> TextSectionIndex = std::nullopt) const;
+ readBBAddrMap(std::optional<unsigned> TextSectionIndex = std::nullopt) const;
};
class ELFSectionRef : public SectionRef {
/// If the optional is None, no header was found, but the object was
/// well-formed.
- Expected<Optional<MachO::dyld_chained_fixups_header>>
+ Expected<std::optional<MachO::dyld_chained_fixups_header>>
getChainedFixupsHeader() const;
Expected<std::vector<ChainedFixupTarget>> getDyldChainedFixupTargets() const;
// Note: This is a limited, temporary API, which will be removed when Apple
// upstreams their implementation. Please do not rely on this.
- Expected<Optional<MachO::linkedit_data_command>>
+ Expected<std::optional<MachO::linkedit_data_command>>
getChainedFixupsLoadCommand() const;
// Returns the number of sections listed in dyld_chained_starts_in_image, and
// a ChainedFixupsSegment for each segment that has fixups.
/// Returns the raw contents of the stream of the given type, or None if the
/// file does not contain a stream of this type.
- Optional<ArrayRef<uint8_t>> getRawStream(minidump::StreamType Type) const;
+ std::optional<ArrayRef<uint8_t>>
+ getRawStream(minidump::StreamType Type) const;
/// Returns the raw contents of an object given by the LocationDescriptor. An
/// error is returned if the descriptor points outside of the minidump file.
template <typename T>
Expected<const T &> MinidumpFile::getStream(minidump::StreamType Type) const {
- if (Optional<ArrayRef<uint8_t>> Stream = getRawStream(Type)) {
+ if (std::optional<ArrayRef<uint8_t>> Stream = getRawStream(Type)) {
if (Stream->size() >= sizeof(T))
return *reinterpret_cast<const T *>(Stream->data());
return createEOFError();
virtual StringRef getFileFormatName() const = 0;
virtual Triple::ArchType getArch() const = 0;
virtual SubtargetFeatures getFeatures() const = 0;
- virtual Optional<StringRef> tryGetCPUName() const { return std::nullopt; };
+ virtual std::optional<StringRef> tryGetCPUName() const {
+ return std::nullopt;
+ };
virtual void setARMSubArch(Triple &TheTriple) const { }
virtual Expected<uint64_t> getStartAddress() const {
return errorCodeToError(object_error::parse_failed);
std::vector<wasm::WasmExport> Exports;
std::vector<wasm::WasmElemSegment> ElemSegments;
std::vector<WasmSegment> DataSegments;
- llvm::Optional<size_t> DataCount;
+ std::optional<size_t> DataCount;
std::vector<wasm::WasmFunction> Functions;
std::vector<WasmSymbol> Symbols;
std::vector<wasm::WasmDebugName> DebugNames;
class XCOFFTracebackTable {
const uint8_t *const TBPtr;
- Optional<SmallString<32>> ParmsType;
- Optional<uint32_t> TraceBackTableOffset;
- Optional<uint32_t> HandlerMask;
- Optional<uint32_t> NumOfCtlAnchors;
- Optional<SmallVector<uint32_t, 8>> ControlledStorageInfoDisp;
- Optional<StringRef> FunctionName;
- Optional<uint8_t> AllocaRegister;
- Optional<TBVectorExt> VecExt;
- Optional<uint8_t> ExtensionTable;
+ std::optional<SmallString<32>> ParmsType;
+ std::optional<uint32_t> TraceBackTableOffset;
+ std::optional<uint32_t> HandlerMask;
+ std::optional<uint32_t> NumOfCtlAnchors;
+ std::optional<SmallVector<uint32_t, 8>> ControlledStorageInfoDisp;
+ std::optional<StringRef> FunctionName;
+ std::optional<uint8_t> AllocaRegister;
+ std::optional<TBVectorExt> VecExt;
+ std::optional<uint8_t> ExtensionTable;
XCOFFTracebackTable(const uint8_t *Ptr, uint64_t &Size, Error &Err);
uint8_t getNumberOfFPParms() const;
bool hasParmsOnStack() const;
- const Optional<SmallString<32>> &getParmsType() const { return ParmsType; }
- const Optional<uint32_t> &getTraceBackTableOffset() const {
+ const std::optional<SmallString<32>> &getParmsType() const {
+ return ParmsType;
+ }
+ const std::optional<uint32_t> &getTraceBackTableOffset() const {
return TraceBackTableOffset;
}
- const Optional<uint32_t> &getHandlerMask() const { return HandlerMask; }
- const Optional<uint32_t> &getNumOfCtlAnchors() { return NumOfCtlAnchors; }
- const Optional<SmallVector<uint32_t, 8>> &getControlledStorageInfoDisp() {
+ const std::optional<uint32_t> &getHandlerMask() const { return HandlerMask; }
+ const std::optional<uint32_t> &getNumOfCtlAnchors() {
+ return NumOfCtlAnchors;
+ }
+ const std::optional<SmallVector<uint32_t, 8>> &
+ getControlledStorageInfoDisp() {
return ControlledStorageInfoDisp;
}
- const Optional<StringRef> &getFunctionName() const { return FunctionName; }
- const Optional<uint8_t> &getAllocaRegister() const { return AllocaRegister; }
- const Optional<TBVectorExt> &getVectorExt() const { return VecExt; }
- const Optional<uint8_t> &getExtensionTable() const { return ExtensionTable; }
+ const std::optional<StringRef> &getFunctionName() const {
+ return FunctionName;
+ }
+ const std::optional<uint8_t> &getAllocaRegister() const {
+ return AllocaRegister;
+ }
+ const std::optional<TBVectorExt> &getVectorExt() const { return VecExt; }
+ const std::optional<uint8_t> &getExtensionTable() const {
+ return ExtensionTable;
+ }
};
bool doesXCOFFTracebackTableBegin(ArrayRef<uint8_t> Bytes);
}
if (!BIDFetcher)
return false;
- if (Optional<std::string> Path = BIDFetcher->fetch(BuildID)) {
+ if (std::optional<std::string> Path = BIDFetcher->fetch(BuildID)) {
Result = *Path;
auto InsertResult = BuildIDPaths.insert({BuildIDStr, Result});
assert(InsertResult.second);
using namespace llvm;
-Optional<std::string>
+std::optional<std::string>
DebuginfodFetcher::fetch(ArrayRef<uint8_t> BuildID) const {
- if (Optional<std::string> Path = BuildIDFetcher::fetch(BuildID))
+ if (std::optional<std::string> Path = BuildIDFetcher::fetch(BuildID))
return std::move(*Path);
Expected<std::string> PathOrErr = getCachedOrDownloadDebuginfo(BuildID);
if (!Object)
continue;
- Optional<BuildIDRef> ID = getBuildID(Object);
+ std::optional<BuildIDRef> ID = getBuildID(Object);
if (!ID)
continue;
//===----------------------------------------------------------------------===//
#include "llvm/Object/Archive.h"
-#include "llvm/ADT/Optional.h"
#include "llvm/ADT/SmallString.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/ADT/Twine.h"
return read32le(buf);
}
-Expected<Optional<Archive::Child>> Archive::findSym(StringRef name) const {
+Expected<std::optional<Archive::Child>> Archive::findSym(StringRef name) const {
Archive::symbol_iterator bs = symbol_begin();
Archive::symbol_iterator es = symbol_end();
namespace {
template <typename ELFT>
-Optional<BuildIDRef> getBuildID(const ELFFile<ELFT> &Obj) {
+std::optional<BuildIDRef> getBuildID(const ELFFile<ELFT> &Obj) {
auto PhdrsOrErr = Obj.program_headers();
if (!PhdrsOrErr) {
consumeError(PhdrsOrErr.takeError());
} // namespace
-Optional<BuildIDRef> getBuildID(const ObjectFile *Obj) {
+std::optional<BuildIDRef> getBuildID(const ObjectFile *Obj) {
if (auto *O = dyn_cast<ELFObjectFile<ELF32LE>>(Obj))
return getBuildID(O->getELFFile());
if (auto *O = dyn_cast<ELFObjectFile<ELF32BE>>(Obj))
return std::nullopt;
}
-Optional<std::string> BuildIDFetcher::fetch(BuildIDRef BuildID) const {
+std::optional<std::string> BuildIDFetcher::fetch(BuildIDRef BuildID) const {
auto GetDebugPath = [&](StringRef Directory) {
SmallString<128> Path{Directory};
sys::path::append(Path, ".build-id",
}
}
-Optional<StringRef> ELFObjectFileBase::tryGetCPUName() const {
+std::optional<StringRef> ELFObjectFileBase::tryGetCPUName() const {
switch (getEMachine()) {
case ELF::EM_AMDGPU:
return getAMDGPUCPUName();
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();
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;
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());
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();
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))
return makeArrayRef(Ptr, DyldInfo.export_size);
}
-Expected<Optional<MachO::linkedit_data_command>>
+Expected<std::optional<MachO::linkedit_data_command>>
MachOObjectFile::getChainedFixupsLoadCommand() const {
// Load the dyld chained fixups load command.
if (!DyldChainedFixupsLoadCmd)
return DyldChainedFixups;
}
-Expected<Optional<MachO::dyld_chained_fixups_header>>
+Expected<std::optional<MachO::dyld_chained_fixups_header>>
MachOObjectFile::getChainedFixupsHeader() const {
auto CFOrErr = getChainedFixupsLoadCommand();
if (!CFOrErr)
using namespace llvm::object;
using namespace llvm::minidump;
-Optional<ArrayRef<uint8_t>>
+std::optional<ArrayRef<uint8_t>>
MinidumpFile::getRawStream(minidump::StreamType Type) const {
auto It = StreamMap.find(Type);
if (It != StreamMap.end())
Expected<iterator_range<MinidumpFile::MemoryInfoIterator>>
MinidumpFile::getMemoryInfoList() const {
- Optional<ArrayRef<uint8_t>> Stream = getRawStream(StreamType::MemoryInfoList);
+ std::optional<ArrayRef<uint8_t>> Stream =
+ getRawStream(StreamType::MemoryInfoList);
if (!Stream)
return createError("No such stream");
auto ExpectedHeader =
template <typename T>
Expected<ArrayRef<T>> MinidumpFile::getListStream(StreamType Type) const {
- Optional<ArrayRef<uint8_t>> Stream = getRawStream(Type);
+ std::optional<ArrayRef<uint8_t>> Stream = getRawStream(Type);
if (!Stream)
return createError("No such stream");
auto ExpectedSize = getDataSliceAs<support::ulittle32_t>(*Stream, 0, 1);
// Find a debug file in local build ID directories and via debuginfod.
std::string fetchDebugInfo(object::BuildIDRef BuildID) {
- if (Optional<std::string> Path =
+ if (std::optional<std::string> Path =
DebuginfodFetcher(DebugFileDirectory).fetch(BuildID))
return *Path;
errs() << "Build ID " << llvm::toHex(BuildID, /*Lowercase=*/true)
// Tries to fetch a more complete version of the given object file using its
// Build ID. Returns None if nothing was found.
-static Optional<OwningBinary<Binary>>
+static std::optional<OwningBinary<Binary>>
fetchBinaryByBuildID(const ObjectFile &Obj) {
- Optional<object::BuildIDRef> BuildID = getBuildID(&Obj);
+ std::optional<object::BuildIDRef> BuildID = getBuildID(&Obj);
if (!BuildID)
return std::nullopt;
- Optional<std::string> Path = BIDFetcher->fetch(*BuildID);
+ std::optional<std::string> Path = BIDFetcher->fetch(*BuildID);
if (!Path)
return std::nullopt;
Expected<OwningBinary<Binary>> DebugBinary = createBinary(*Path);
LLVM_DEBUG(LVP.dump());
std::unordered_map<uint64_t, BBAddrMap> AddrToBBAddrMap;
- auto ReadBBAddrMap = [&](Optional<unsigned> SectionIndex = std::nullopt) {
+ auto ReadBBAddrMap = [&](std::optional<unsigned> SectionIndex =
+ std::nullopt) {
AddrToBBAddrMap.clear();
if (const auto *Elf = dyn_cast<ELFObjectFileBase>(&Obj)) {
auto BBAddrMapsOrErr = Elf->readBBAddrMap(SectionIndex);
// more complete binary and disassemble that instead.
OwningBinary<Binary> FetchedBinary;
if (Obj->symbols().empty()) {
- if (Optional<OwningBinary<Binary>> FetchedBinaryOpt =
+ if (std::optional<OwningBinary<Binary>> FetchedBinaryOpt =
fetchBinaryByBuildID(*Obj)) {
if (auto *O = dyn_cast<ObjectFile>(FetchedBinaryOpt->getBinary())) {
if (!O->symbols().empty() ||
const ObjectFile *DbgObj = Obj;
if (!FetchedBinary.getBinary() && !Obj->hasDebugInfo()) {
- if (Optional<OwningBinary<Binary>> DebugBinaryOpt =
+ if (std::optional<OwningBinary<Binary>> DebugBinaryOpt =
fetchBinaryByBuildID(*Obj)) {
if (auto *FetchedObj =
dyn_cast<const ObjectFile>(DebugBinaryOpt->getBinary())) {
// Look up any provided build IDs, then append them to the input filenames.
for (const opt::Arg *A : InputArgs.filtered(OBJDUMP_build_id)) {
object::BuildID BuildID = parseBuildIDArg(A);
- Optional<std::string> Path = BIDFetcher->fetch(BuildID);
+ std::optional<std::string> Path = BIDFetcher->fetch(BuildID);
if (!Path) {
reportCmdLineError(A->getSpelling() + ": could not find build ID '" +
A->getValue() + "'");
Expected<StringRef> getSymbolVersion(const Elf_Sym &Sym,
bool &IsDefault) const;
- Expected<SmallVector<Optional<VersionEntry>, 0> *> getVersionMap() const;
+ Expected<SmallVector<std::optional<VersionEntry>, 0> *> getVersionMap() const;
DynRegionInfo DynRelRegion;
DynRegionInfo DynRelaRegion;
ArrayRef<Elf_Word> getShndxTable(const Elf_Shdr *Symtab) const;
private:
- mutable SmallVector<Optional<VersionEntry>, 0> VersionMap;
+ mutable SmallVector<std::optional<VersionEntry>, 0> VersionMap;
};
template <class ELFT>
} // end namespace llvm
template <class ELFT>
-Expected<SmallVector<Optional<VersionEntry>, 0> *>
+Expected<SmallVector<std::optional<VersionEntry>, 0> *>
ELFDumper<ELFT>::getVersionMap() const {
// If the VersionMap has already been loaded or if there is no dynamic symtab
// or version table, there is nothing to do.
if (!VersionMap.empty() || !DynSymRegion || !SymbolVersionSection)
return &VersionMap;
- Expected<SmallVector<Optional<VersionEntry>, 0>> MapOrErr =
+ Expected<SmallVector<std::optional<VersionEntry>, 0>> MapOrErr =
Obj.loadVersionMap(SymbolVersionNeedSection, SymbolVersionDefSection);
if (MapOrErr)
VersionMap = *MapOrErr;
return "";
}
- Expected<SmallVector<Optional<VersionEntry>, 0> *> MapOrErr =
+ Expected<SmallVector<std::optional<VersionEntry>, 0> *> MapOrErr =
getVersionMap();
if (!MapOrErr)
return MapOrErr.takeError();
return;
}
- SmallVector<Optional<VersionEntry>, 0> *VersionMap = nullptr;
- if (Expected<SmallVector<Optional<VersionEntry>, 0> *> MapOrErr =
+ SmallVector<std::optional<VersionEntry>, 0> *VersionMap = nullptr;
+ if (Expected<SmallVector<std::optional<VersionEntry>, 0> *> MapOrErr =
this->getVersionMap())
VersionMap = *MapOrErr;
else
dxbc::PartType PT = dxbc::parsePartType(P.Part.getName());
switch (PT) {
case dxbc::PartType::DXIL: {
- Optional<DXContainer::DXILData> DXIL = Container.getDXIL();
+ std::optional<DXContainer::DXILData> DXIL = Container.getDXIL();
assert(DXIL && "Since we are iterating and found a DXIL part, "
"this should never not have a value");
NewPart.Program = DXContainerYAML::DXILProgram{
break;
}
case dxbc::PartType::SFI0: {
- Optional<uint64_t> Flags = Container.getShaderFlags();
+ std::optional<uint64_t> Flags = Container.getShaderFlags();
// Omit the flags in the YAML if they are missing or zero.
if (Flags && *Flags > 0)
NewPart.Flags = DXContainerYAML::ShaderFlags(*Flags);
break;
}
case dxbc::PartType::HASH: {
- Optional<dxbc::ShaderHash> Hash = Container.getShaderHash();
+ std::optional<dxbc::ShaderHash> Hash = Container.getShaderHash();
if (Hash && Hash->isPopulated())
NewPart.Hash = DXContainerYAML::ShaderHash(*Hash);
break;
std::vector<BBAddrMap> AllBBAddrMaps = {E1, E2, E3};
auto DoCheckSucceeds = [&](StringRef YamlString,
- Optional<unsigned> TextSectionIndex,
+ std::optional<unsigned> TextSectionIndex,
std::vector<BBAddrMap> ExpectedResult) {
SmallString<0> Storage;
Expected<ELFObjectFile<ELF64LE>> ElfOrErr =
};
auto DoCheckFails = [&](StringRef YamlString,
- Optional<unsigned> TextSectionIndex,
+ std::optional<unsigned> TextSectionIndex,
const char *ErrMsg) {
SmallString<0> Storage;
Expected<ELFObjectFile<ELF64LE>> ElfOrErr =