if (TI.getTriple().getOS() == llvm::Triple::ShaderModel) {
VersionTuple Version = TI.getTriple().getOSVersion();
Builder.defineMacro("__SHADER_TARGET_MAJOR", Twine(Version.getMajor()));
- unsigned Minor = Version.getMinor() ? *Version.getMinor() : 0;
+ unsigned Minor = Version.getMinor().getValueOr(0);
Builder.defineMacro("__SHADER_TARGET_MINOR", Twine(Minor));
}
return;
if (!Filter.SymbolOffset)
return visitSymbolStream(Symbols);
uint32_t SymbolOffset = *Filter.SymbolOffset;
- uint32_t ParentRecurseDepth =
- Filter.ParentRecursiveDepth ? *Filter.ParentRecursiveDepth : 0;
- uint32_t ChildrenRecurseDepth =
- Filter.ChildRecursiveDepth ? *Filter.ChildRecursiveDepth : 0;
+ uint32_t ParentRecurseDepth = Filter.ParentRecursiveDepth.getValueOr(0);
+ uint32_t ChildrenRecurseDepth = Filter.ChildRecursiveDepth.getValueOr(0);
if (!Symbols.isOffsetValid(SymbolOffset))
return createStringError(inconvertibleErrorCode(), "Invalid symbol offset");
CVSymbol Sym = *Symbols.at(SymbolOffset);
// time as long as it is not SHN_UNDEF. Set shndx to 1, which
// points to ".dynsym".
uint16_t Shndx = Sym.Undefined ? SHN_UNDEF : 1;
- uint64_t Size = Sym.Size ? *Sym.Size : 0;
+ uint64_t Size = Sym.Size.getValueOr(0);
DynSym.Content.add(DynStr.Content.getOffset(Sym.Name), Size, Bind,
convertIFSSymbolTypeToELF(Sym.Type), 0, Shndx);
}