LLVM  16.0.0git
Namespaces | Functions | Variables
DWP.cpp File Reference
#include "llvm/DWP/DWP.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/MemoryBuffer.h"
#include <limits>
Include dependency graph for DWP.cpp:

Go to the source code of this file.


 This is an optimization pass for GlobalISel generic memory operations.


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 void addAllTypesFromDWP (MCStreamer &Out, MapVector< uint64_t, UnitIndexEntry > &TypeIndexEntries, const DWARFUnitIndex &TUIndex, MCSection *OutputTypes, StringRef Types, const UnitIndexEntry &TUEntry, uint32_t &TypesOffset, unsigned TypesContributionIndex)
static void addAllTypesFromTypesSection (MCStreamer &Out, MapVector< uint64_t, UnitIndexEntry > &TypeIndexEntries, MCSection *OutputTypes, const std::vector< StringRef > &TypesSections, const UnitIndexEntry &CUEntry, uint32_t &TypesOffset)
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)
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, uint32_t DWARFUnitIndex::Entry::SectionContribution::*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)


static mc::RegisterMCTargetOptionsFlags MCTargetOptionsFlags

Function Documentation

◆ addAllTypesFromDWP()

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

◆ addAllTypesFromTypesSection()

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

Definition at line 216 of file DWP.cpp.

References llvm::Data, and llvm::MCStreamer::switchSection().

◆ buildDWODescription()

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

Definition at line 250 of file DWP.cpp.

References llvm::StringRef::empty().

Referenced by llvm::buildDuplicateError().

◆ createError()

static Error createError ( StringRef  Name,
Error  E 

Definition at line 276 of file DWP.cpp.

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

◆ debugStrOffsetsHeaderSize()

static uint64_t debugStrOffsetsHeaderSize ( DataExtractor  StrOffsetsData,
uint16_t  DwarfVersion 

Definition at line 29 of file DWP.cpp.

References llvm::dwarf::DW_LENGTH_DWARF64, and llvm::DataExtractor::getU32().

Referenced by getIndexedString().

◆ getCUAbbrev()

static uint64_t getCUAbbrev ( StringRef  Abbrev,
uint64_t  AbbrCode 

Definition at line 40 of file DWP.cpp.

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

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 168 of file DWP.cpp.

Referenced by llvm::writeIndex().

◆ getSubsection()

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

Definition at line 172 of file DWP.cpp.

◆ handleCompressedSection()

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

◆ isSupportedSectionKind()

static bool isSupportedSectionKind ( DWARFSectionKind  Kind)

Definition at line 153 of file DWP.cpp.

References llvm::DW_SECT_EXT_unknown.

Variable Documentation

◆ MCTargetOptionsFlags

mc::RegisterMCTargetOptionsFlags MCTargetOptionsFlags

Definition at line 26 of file DWP.cpp.