LLVM 19.0.0git
Classes | Public Member Functions | List of all members
llvm::DwarfFile Class Reference

#include "CodeGen/AsmPrinter/DwarfFile.h"

Public Member Functions

 DwarfFile (AsmPrinter *AP, StringRef Pref, BumpPtrAllocator &DA)
 
const SmallVectorImpl< std::unique_ptr< DwarfCompileUnit > > & getUnits ()
 
std::pair< uint32_t, RangeSpanList * > addRange (const DwarfCompileUnit &CU, SmallVector< RangeSpan, 2 > R)
 
const SmallVectorImpl< RangeSpanList > & getRangeLists () const
 getRangeLists - Get the vector of range lists.
 
unsigned computeSizeAndOffset (DIE &Die, unsigned Offset)
 Compute the size and offset of a DIE given an incoming Offset.
 
void computeSizeAndOffsets ()
 Compute the size and offset of all the DIEs.
 
unsigned computeSizeAndOffsetsForUnit (DwarfUnit *TheU)
 Compute the size and offset of all the DIEs in the given unit.
 
void addUnit (std::unique_ptr< DwarfCompileUnit > U)
 Add a unit to the list of CUs.
 
void emitUnits (bool UseOffsets)
 Emit all of the units to the section listed with the given abbreviation section.
 
void emitUnit (DwarfUnit *TheU, bool UseOffsets)
 Emit the given unit to its section.
 
void emitAbbrevs (MCSection *)
 Emit a set of abbreviations to the specific section.
 
void emitStrings (MCSection *StrSection, MCSection *OffsetSection=nullptr, bool UseRelativeOffsets=false)
 Emit all of the strings to the section given.
 
DwarfStringPoolgetStringPool ()
 Returns the string pool.
 
MCSymbolgetStringOffsetsStartSym () const
 
void setStringOffsetsStartSym (MCSymbol *Sym)
 
MCSymbolgetRnglistsTableBaseSym () const
 
void setRnglistsTableBaseSym (MCSymbol *Sym)
 
void addScopeVariable (LexicalScope *LS, DbgVariable *Var)
 
void addScopeLabel (LexicalScope *LS, DbgLabel *Label)
 
DenseMap< LexicalScope *, ScopeVars > & getScopeVariables ()
 
DenseMap< LexicalScope *, LabelList > & getScopeLabels ()
 
DenseMap< const DILocalScope *, DIE * > & getAbstractScopeDIEs ()
 
DenseMap< const DINode *, std::unique_ptr< DbgEntity > > & getAbstractEntities ()
 
void insertDIE (const MDNode *TypeMD, DIE *Die)
 
DIEgetDIE (const MDNode *TypeMD)
 

Detailed Description

Definition at line 50 of file DwarfFile.h.

Constructor & Destructor Documentation

◆ DwarfFile()

DwarfFile::DwarfFile ( AsmPrinter AP,
StringRef  Pref,
BumpPtrAllocator DA 
)

Definition at line 20 of file DwarfFile.cpp.

Member Function Documentation

◆ addRange()

std::pair< uint32_t, RangeSpanList * > DwarfFile::addRange ( const DwarfCompileUnit CU,
SmallVector< RangeSpan, 2 >  R 
)

Definition at line 123 of file DwarfFile.cpp.

References llvm::AsmPrinter::createTempSymbol().

◆ addScopeLabel()

void DwarfFile::addScopeLabel ( LexicalScope LS,
DbgLabel Label 
)

Definition at line 117 of file DwarfFile.cpp.

References llvm::Labels.

Referenced by llvm::DwarfCompileUnit::createAbstractEntity().

◆ addScopeVariable()

void DwarfFile::addScopeVariable ( LexicalScope LS,
DbgVariable Var 
)

◆ addUnit()

void DwarfFile::addUnit ( std::unique_ptr< DwarfCompileUnit U)

Add a unit to the list of CUs.

Definition at line 23 of file DwarfFile.cpp.

◆ computeSizeAndOffset()

unsigned DwarfFile::computeSizeAndOffset ( DIE Die,
unsigned  Offset 
)

Compute the size and offset of a DIE given an incoming Offset.

Definition at line 92 of file DwarfFile.cpp.

References llvm::DIE::computeOffsetsAndAbbrevs(), llvm::AsmPrinter::getDwarfFormParams(), and llvm::Offset.

Referenced by computeSizeAndOffsetsForUnit().

◆ computeSizeAndOffsets()

void DwarfFile::computeSizeAndOffsets ( )

Compute the size and offset of all the DIEs.

Definition at line 57 of file DwarfFile.cpp.

References computeSizeAndOffsetsForUnit(), llvm::AsmPrinter::isDwarf64(), and llvm::report_fatal_error().

◆ computeSizeAndOffsetsForUnit()

unsigned DwarfFile::computeSizeAndOffsetsForUnit ( DwarfUnit TheU)

Compute the size and offset of all the DIEs in the given unit.

Returns
The size of the root DIE.

Definition at line 80 of file DwarfFile.cpp.

References computeSizeAndOffset(), llvm::DwarfUnit::getHeaderSize(), llvm::DIEUnit::getUnitDie(), llvm::AsmPrinter::getUnitLengthFieldByteSize(), and llvm::Offset.

Referenced by llvm::DwarfDebug::addDwarfTypeUnitType(), and computeSizeAndOffsets().

◆ emitAbbrevs()

void DwarfFile::emitAbbrevs ( MCSection Section)

Emit a set of abbreviations to the specific section.

Definition at line 97 of file DwarfFile.cpp.

References llvm::DIEAbbrevSet::Emit().

◆ emitStrings()

void DwarfFile::emitStrings ( MCSection StrSection,
MCSection OffsetSection = nullptr,
bool  UseRelativeOffsets = false 
)

Emit all of the strings to the section given.

If OffsetSection is non-null, emit a table of string offsets to it. If UseRelativeOffsets is false, emit absolute offsets to the strings. Otherwise, emit relocatable references to the strings if they are supported by the target.

Definition at line 100 of file DwarfFile.cpp.

References llvm::DwarfStringPool::emit().

◆ emitUnit()

void DwarfFile::emitUnit ( DwarfUnit TheU,
bool  UseOffsets 
)

◆ emitUnits()

void DwarfFile::emitUnits ( bool  UseOffsets)

Emit all of the units to the section listed with the given abbreviation section.

Definition at line 29 of file DwarfFile.cpp.

References emitUnit().

◆ getAbstractEntities()

DenseMap< const DINode *, std::unique_ptr< DbgEntity > > & llvm::DwarfFile::getAbstractEntities ( )
inline

Definition at line 169 of file DwarfFile.h.

◆ getAbstractScopeDIEs()

DenseMap< const DILocalScope *, DIE * > & llvm::DwarfFile::getAbstractScopeDIEs ( )
inline

◆ getDIE()

DIE * llvm::DwarfFile::getDIE ( const MDNode TypeMD)
inline

◆ getRangeLists()

const SmallVectorImpl< RangeSpanList > & llvm::DwarfFile::getRangeLists ( ) const
inline

getRangeLists - Get the vector of range lists.

Definition at line 110 of file DwarfFile.h.

Referenced by emitRnglistsTableHeader().

◆ getRnglistsTableBaseSym()

MCSymbol * llvm::DwarfFile::getRnglistsTableBaseSym ( ) const
inline

Definition at line 150 of file DwarfFile.h.

Referenced by llvm::DwarfUnit::addRnglistsBase(), and emitRnglistsTableHeader().

◆ getScopeLabels()

DenseMap< LexicalScope *, LabelList > & llvm::DwarfFile::getScopeLabels ( )
inline

◆ getScopeVariables()

DenseMap< LexicalScope *, ScopeVars > & llvm::DwarfFile::getScopeVariables ( )
inline

◆ getStringOffsetsStartSym()

MCSymbol * llvm::DwarfFile::getStringOffsetsStartSym ( ) const
inline

Definition at line 147 of file DwarfFile.h.

Referenced by llvm::DwarfUnit::addStringOffsetsStart().

◆ getStringPool()

DwarfStringPool & llvm::DwarfFile::getStringPool ( )
inline

Returns the string pool.

Definition at line 145 of file DwarfFile.h.

Referenced by llvm::DwarfUnit::addString().

◆ getUnits()

const SmallVectorImpl< std::unique_ptr< DwarfCompileUnit > > & llvm::DwarfFile::getUnits ( )
inline

Definition at line 102 of file DwarfFile.h.

◆ insertDIE()

void llvm::DwarfFile::insertDIE ( const MDNode TypeMD,
DIE Die 
)
inline

◆ setRnglistsTableBaseSym()

void llvm::DwarfFile::setRnglistsTableBaseSym ( MCSymbol Sym)
inline

Definition at line 151 of file DwarfFile.h.

References Sym.

Referenced by llvm::DwarfDebug::beginModule().

◆ setStringOffsetsStartSym()

void llvm::DwarfFile::setStringOffsetsStartSym ( MCSymbol Sym)
inline

Definition at line 148 of file DwarfFile.h.

References Sym.


The documentation for this class was generated from the following files: