LLVM 19.0.0git
Namespaces | Enumerations | Functions | Variables
DWP.cpp File Reference
#include "llvm/DWP/DWP.h"
#include "llvm/ADT/Twine.h"
#include "llvm/DWP/DWPError.h"
#include "llvm/MC/MCContext.h"
#include "llvm/MC/MCObjectFileInfo.h"
#include "llvm/MC/MCTargetOptionsCommandFlags.h"
#include "llvm/Object/Decompressor.h"
#include "llvm/Object/ELFObjectFile.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/MemoryBuffer.h"
#include <limits>

Go to the source code of this file.


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


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


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)
unsigned llvm::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 (MCStreamer &Out, MapVector< uint64_t, UnitIndexEntry > &TypeIndexEntries, const DWARFUnitIndex &TUIndex, MCSection *OutputTypes, StringRef Types, const UnitIndexEntry &TUEntry, uint32_t &TypesOffset, unsigned TypesContributionIndex, OnCuIndexOverflow OverflowOptValue, bool &AnySectionOverflow)
static Error addAllTypesFromTypesSection (MCStreamer &Out, MapVector< uint64_t, UnitIndexEntry > &TypeIndexEntries, MCSection *OutputTypes, 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)
Expected< InfoSectionUnitHeaderllvm::parseInfoSectionUnitHeader (StringRef Info)
static void llvm::writeNewOffsetsTo (MCStreamer &Out, DataExtractor &Data, DenseMap< uint64_t, uint32_t > &OffsetRemapping, uint64_t &Offset, uint64_t &Size)
void llvm::writeStringsAndOffsets (MCStreamer &Out, DWPStringPool &Strings, MCSection *StrOffsetSection, StringRef CurStrSection, StringRef CurStrOffsetSection, uint16_t Version)
void llvm::writeIndexTable (MCStreamer &Out, ArrayRef< unsigned > ContributionOffsets, const MapVector< uint64_t, UnitIndexEntry > &IndexEntries, const AccessField &Field)
void llvm::writeIndex (MCStreamer &Out, MCSection *Section, ArrayRef< unsigned > ContributionOffsets, const MapVector< uint64_t, UnitIndexEntry > &IndexEntries, uint32_t IndexVersion)
Error llvm::buildDuplicateError (const std::pair< uint64_t, UnitIndexEntry > &PrevE, const CompileUnitIdentifiers &ID, StringRef DWPName)
Error llvm::handleSection (const StringMap< std::pair< MCSection *, DWARFSectionKind > > &KnownSections, const MCSection *StrSection, const MCSection *StrOffsetSection, const MCSection *TypesSection, const MCSection *CUIndexSection, const MCSection *TUIndexSection, const MCSection *InfoSection, const object::SectionRef &Section, MCStreamer &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, std::vector< std::pair< DWARFSectionKind, uint32_t > > &SectionLength)
Error llvm::write (MCStreamer &Out, ArrayRef< std::string > Inputs, OnCuIndexOverflow OverflowOptValue)


static mc::RegisterMCTargetOptionsFlags MCTargetOptionsFlags

Function Documentation

◆ addAllTypesFromDWP()

static Error addAllTypesFromDWP ( MCStreamer Out,
MapVector< uint64_t, UnitIndexEntry > &  TypeIndexEntries,
const DWARFUnitIndex TUIndex,
MCSection OutputTypes,
StringRef  Types,
const UnitIndexEntry TUEntry,
uint32_t TypesOffset,
unsigned  TypesContributionIndex,
OnCuIndexOverflow  OverflowOptValue,
bool AnySectionOverflow 

◆ addAllTypesFromTypesSection()

static Error addAllTypesFromTypesSection ( MCStreamer Out,
MapVector< uint64_t, UnitIndexEntry > &  TypeIndexEntries,
MCSection OutputTypes,
const std::vector< StringRef > &  TypesSections,
const UnitIndexEntry CUEntry,
uint32_t TypesOffset,
OnCuIndexOverflow  OverflowOptValue,
bool AnySectionOverflow 

◆ buildDWODescription()

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

Definition at line 301 of file DWP.cpp.

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

Referenced by llvm::buildDuplicateError().

◆ createError()

static Error createError ( StringRef  Name,
Error  E 

Definition at line 327 of file DWP.cpp.

References Name, and llvm::dwarf::toString().

Referenced by handleCompressedSection().

◆ debugStrOffsetsHeaderSize()

static uint64_t debugStrOffsetsHeaderSize ( DataExtractor  StrOffsetsData,
uint16_t  DwarfVersion 

◆ getCUAbbrev()

static uint64_t getCUAbbrev ( StringRef  Abbrev,
uint64_t  AbbrCode 

Definition at line 42 of file DWP.cpp.

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

Referenced by getCUIdentifiers().

◆ getCUIdentifiers()

static Expected< CompileUnitIdentifiers > getCUIdentifiers ( InfoSectionUnitHeader Header,
StringRef  Abbrev,
StringRef  Info,
StringRef  StrOffsets,
StringRef  Str 

◆ getIndexedString()

static Expected< const char * > getIndexedString ( dwarf::Form  Form,
DataExtractor  InfoData,
uint64_t InfoOffset,
StringRef  StrOffsets,
StringRef  Str,
uint16_t  Version 

◆ getOnDiskSectionId()

static unsigned getOnDiskSectionId ( unsigned  Index)

Definition at line 170 of file DWP.cpp.

Referenced by llvm::writeIndex().

◆ getSubsection()

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

Definition at line 174 of file DWP.cpp.

Referenced by llvm::write().

◆ handleCompressedSection()

static Error handleCompressedSection ( std::deque< SmallString< 32 > > &  UncompressedSections,
SectionRef  Sec,
StringRef  Name,
StringRef Contents 

◆ isSupportedSectionKind()

static bool isSupportedSectionKind ( DWARFSectionKind  Kind)

Definition at line 155 of file DWP.cpp.

References llvm::DW_SECT_EXT_unknown.

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

◆ sectionOverflowErrorOrWarning()

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

Variable Documentation

◆ MCTargetOptionsFlags

mc::RegisterMCTargetOptionsFlags MCTargetOptionsFlags

Definition at line 28 of file DWP.cpp.