LLVM 23.0.0git
DXContainer.cpp File Reference

Go to the source code of this file.

Classes

class  DXNotSupportedError

Functions

static Error parseFailed (const Twine &Msg)
static bool readIsOutOfBounds (StringRef Buffer, const char *Src, size_t Size)
template<typename T, bool FixEndianness = true>
static Error readStruct (StringRef Buffer, const char *Src, T &Struct)
template<typename T>
static Error readInteger (StringRef Buffer, const char *Src, T &Val, Twine Str="structure")
static Error readString (StringRef Buffer, const char *&Src, size_t MaxSize, StringRef &Val, Twine Desc)
 Read a null-terminated string at the position Src from Buffer, with maximum byte size of MaxSize (including the null-terminator).
static Expected< size_tparseNames (StringRef Section, mcdxbc::SourceInfo::SourceNames &Names)
static Expected< size_tparseUncompressedContentsEntries (StringRef Entries, mcdxbc::SourceInfo::SourceContents &Contents)
static Expected< size_tparseContentsEntries (StringRef Entries, mcdxbc::SourceInfo::SourceContents &Contents)
static Expected< size_tparseContents (StringRef Section, mcdxbc::SourceInfo::SourceContents &Contents)
static Expected< size_tparseArgs (StringRef Section, mcdxbc::SourceInfo::ProgramArgs &Args)
static Expected< size_tparseSourceInfoSection (const dxbc::SourceInfo::SectionHeader &Header, StringRef SectionData, mcdxbc::SourceInfo &SourceInfo)

Function Documentation

◆ parseArgs()

◆ parseContents()

◆ parseContentsEntries()

◆ parseFailed()

Error parseFailed ( const Twine & Msg)
static

◆ parseNames()

◆ parseSourceInfoSection()

Expected< size_t > parseSourceInfoSection ( const dxbc::SourceInfo::SectionHeader & Header,
StringRef SectionData,
mcdxbc::SourceInfo & SourceInfo )
static

Definition at line 422 of file DXContainer.cpp.

References llvm_unreachable, parseArgs(), parseContents(), and parseNames().

◆ parseUncompressedContentsEntries()

◆ readInteger()

template<typename T>
Error readInteger ( StringRef Buffer,
const char * Src,
T & Val,
Twine Str = "structure" )
static

◆ readIsOutOfBounds()

bool readIsOutOfBounds ( StringRef Buffer,
const char * Src,
size_t Size )
static

Definition at line 25 of file DXContainer.cpp.

References llvm::StringRef::end(), and Size.

Referenced by readInteger(), readString(), and readStruct().

◆ readString()

Error readString ( StringRef Buffer,
const char *& Src,
size_t MaxSize,
StringRef & Val,
Twine Desc )
static

Read a null-terminated string at the position Src from Buffer, with maximum byte size of MaxSize (including the null-terminator).

Advance Src by the number of bytes read.

Definition at line 68 of file DXContainer.cpp.

References llvm::StringRef::data(), llvm::StringRef::find(), llvm::Length, llvm::StringRef::npos, parseFailed(), readIsOutOfBounds(), llvm::StringRef::substr(), and llvm::Error::success().

Referenced by parseArgs(), parseNames(), parseUncompressedContentsEntries(), and readSection().

◆ readStruct()