Anonymous View
LLVM 23.0.0git
DWP.cpp File Reference

Go to the source code of this file.

Namespaces

namespace  llvm
 This is an optimization pass for GlobalISel generic memory operations.

Enumerations

enum  llvm::AccessField { llvm::Offset , llvm::Length }

Functions

static uint64_t debugStrOffsetsHeaderSize (DataExtractor StrOffsetsData, uint16_t DwarfVersion)
static uint64_t getCUAbbrev (StringRef Abbrev, uint64_t AbbrCode)
static Expected< const char * > getIndexedString (dwarf::Form Form, DataExtractor InfoData, uint64_t &InfoOffset, StringRef StrOffsets, StringRef Str, uint16_t Version)
static Expected< CompileUnitIdentifiersgetCUIdentifiers (InfoSectionUnitHeader &Header, StringRef Abbrev, StringRef Info, StringRef StrOffsets, StringRef Str)
static bool isSupportedSectionKind (DWARFSectionKind Kind)
static unsigned getContributionIndex (DWARFSectionKind Kind, uint32_t IndexVersion)
static unsigned getOnDiskSectionId (unsigned Index)
static StringRef getSubsection (StringRef Section, const DWARFUnitIndex::Entry &Entry, DWARFSectionKind Kind)
static Error sectionOverflowErrorOrWarning (uint32_t PrevOffset, uint32_t OverflowedOffset, StringRef SectionName, OnCuIndexOverflow OverflowOptValue, bool &AnySectionOverflow)
static Error addAllTypesFromDWP (DWPWriter &Out, MapVector< uint64_t, UnitIndexEntry > &TypeIndexEntries, const DWARFUnitIndex &TUIndex, DWPSectionId OutputSection, StringRef Types, const UnitIndexEntry &TUEntry, uint32_t &TypesOffset, unsigned TypesContributionIndex, OnCuIndexOverflow OverflowOptValue, bool &AnySectionOverflow)
static Error addAllTypesFromTypesSection (DWPWriter &Out, MapVector< uint64_t, UnitIndexEntry > &TypeIndexEntries, DWPSectionId OutputSection, const std::vector< StringRef > &TypesSections, const UnitIndexEntry &CUEntry, uint32_t &TypesOffset, OnCuIndexOverflow OverflowOptValue, bool &AnySectionOverflow)
static std::string buildDWODescription (StringRef Name, StringRef DWPName, StringRef DWOName)
static Error createError (StringRef Name, Error E)
static Error handleCompressedSection (std::deque< SmallString< 32 > > &UncompressedSections, SectionRef Sec, StringRef Name, StringRef &Contents)
static Error buildDuplicateError (const std::pair< uint64_t, UnitIndexEntry > &PrevE, const CompileUnitIdentifiers &ID, StringRef DWPName)
static void writeNewOffsetsTo (DWPWriter &Out, DataExtractor &Data, DenseMap< uint64_t, uint64_t > &OffsetRemapping, uint64_t &Offset, const uint64_t Size, uint32_t OldOffsetSize, uint32_t NewOffsetSize)
LLVM_ABI Expected< InfoSectionUnitHeaderllvm::parseInfoSectionUnitHeader (StringRef Info)
static void llvm::writeStringsAndOffsets (DWPWriter &Out, DWPStringPool &Strings, StringRef CurStrSection, StringRef CurStrOffsetSection, uint16_t Version, SectionLengths &SectionLength, const Dwarf64StrOffsetsPromotion StrOffsetsOptValue, bool SingleInput)
static void llvm::writeIndexTable (DWPWriter &Out, ArrayRef< unsigned > ContributionOffsets, const MapVector< uint64_t, UnitIndexEntry > &IndexEntries, const AccessField &Field)
static void llvm::writeIndex (DWPWriter &Out, DWPSectionId Section, ArrayRef< unsigned > ContributionOffsets, const MapVector< uint64_t, UnitIndexEntry > &IndexEntries, uint32_t IndexVersion)
static const StringMap< std::pair< DWPSectionId, DWARFSectionKind > > & llvm::getKnownSections ()
 Map input ELF section names to DWP section IDs and DWARF section kinds.
static Error llvm::handleSection (const StringMap< std::pair< DWPSectionId, DWARFSectionKind > > &KnownSections, const SectionRef &Section, DWPWriter &Out, std::deque< SmallString< 32 > > &UncompressedSections, uint32_t(&ContributionOffsets)[8], UnitIndexEntry &CurEntry, StringRef &CurStrSection, StringRef &CurStrOffsetSection, std::vector< StringRef > &CurTypesSection, std::vector< StringRef > &CurInfoSection, StringRef &AbbrevSection, StringRef &CurCUIndexSection, StringRef &CurTUIndexSection, SectionLengths &SectionLength)
LLVM_ABI Error llvm::write (DWPWriter &Out, ArrayRef< std::string > Inputs, OnCuIndexOverflow OverflowOptValue, Dwarf64StrOffsetsPromotion StrOffsetsOptValue, raw_pwrite_stream *OS=nullptr)

Function Documentation

◆ addAllTypesFromDWP()

◆ addAllTypesFromTypesSection()

◆ buildDuplicateError()

Error buildDuplicateError ( const std::pair< uint64_t, UnitIndexEntry > & PrevE,
const CompileUnitIdentifiers & ID,
StringRef DWPName )
static

Definition at line 357 of file DWP.cpp.

References buildDWODescription(), llvm::make_error(), and llvm::utohexstr().

Referenced by llvm::write().

◆ buildDWODescription()

std::string buildDWODescription ( StringRef Name,
StringRef DWPName,
StringRef DWOName )
static

Definition at line 300 of file DWP.cpp.

References llvm::StringRef::empty(), and llvm::Text.

Referenced by buildDuplicateError().

◆ createError()

Error createError ( StringRef Name,
Error E )
static

Definition at line 326 of file DWP.cpp.

References E(), llvm::make_error(), and llvm::toString().

◆ debugStrOffsetsHeaderSize()

uint64_t debugStrOffsetsHeaderSize ( DataExtractor StrOffsetsData,
uint16_t DwarfVersion )
static

◆ getContributionIndex()

unsigned getContributionIndex ( DWARFSectionKind Kind,
uint32_t IndexVersion )
static

Definition at line 161 of file DWP.cpp.

References assert(), and llvm::serializeSectionKind().

Referenced by addAllTypesFromDWP(), addAllTypesFromTypesSection(), and llvm::write().

◆ getCUAbbrev()

uint64_t getCUAbbrev ( StringRef Abbrev,
uint64_t AbbrCode )
static

Definition at line 42 of file DWP.cpp.

References llvm::DataExtractor::getU8(), llvm::DataExtractor::getULEB128(), and llvm::Offset.

Referenced by getCUIdentifiers().

◆ getCUIdentifiers()

◆ getIndexedString()

◆ getOnDiskSectionId()

unsigned getOnDiskSectionId ( unsigned Index)
static

Definition at line 169 of file DWP.cpp.

Referenced by llvm::writeIndex().

◆ getSubsection()

StringRef getSubsection ( StringRef Section,
const DWARFUnitIndex::Entry & Entry,
DWARFSectionKind Kind )
static

Definition at line 173 of file DWP.cpp.

Referenced by llvm::write().

◆ handleCompressedSection()

◆ isSupportedSectionKind()

bool isSupportedSectionKind ( DWARFSectionKind Kind)
static

Definition at line 155 of file DWP.cpp.

References llvm::DW_SECT_EXT_unknown.

Referenced by addAllTypesFromDWP(), and llvm::write().

◆ sectionOverflowErrorOrWarning()

Error sectionOverflowErrorOrWarning ( uint32_t PrevOffset,
uint32_t OverflowedOffset,
StringRef SectionName,
OnCuIndexOverflow OverflowOptValue,
bool & AnySectionOverflow )
static

◆ writeNewOffsetsTo()

void writeNewOffsetsTo ( DWPWriter & Out,
DataExtractor & Data,
DenseMap< uint64_t, uint64_t > & OffsetRemapping,
uint64_t & Offset,
const uint64_t Size,
uint32_t OldOffsetSize,
uint32_t NewOffsetSize )
static

Definition at line 368 of file DWP.cpp.

References llvm::Data, llvm::DWPWriter::emitIntValue(), llvm::Offset, Size, and UINT64_MAX.

Referenced by llvm::writeStringsAndOffsets().