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

this class represents DWARF information for source file and it`s address map. More...

#include "llvm/DWARFLinker/DWARFLinker.h"

Collaboration diagram for llvm::DwarfFile:
Collaboration graph
[legend]

Public Member Functions

 DwarfFile (StringRef Name, DWARFContext *Dwarf, AddressesMap *Addresses, const std::vector< std::string > &Warnings)
 
 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. More...
 
unsigned computeSizeAndOffset (DIE &Die, unsigned Offset)
 Compute the size and offset of a DIE given an incoming Offset. More...
 
void computeSizeAndOffsets ()
 Compute the size and offset of all the DIEs. More...
 
unsigned computeSizeAndOffsetsForUnit (DwarfUnit *TheU)
 Compute the size and offset of all the DIEs in the given unit. More...
 
void addUnit (std::unique_ptr< DwarfCompileUnit > U)
 Add a unit to the list of CUs. More...
 
void emitUnits (bool UseOffsets)
 Emit all of the units to the section listed with the given abbreviation section. More...
 
void emitUnit (DwarfUnit *TheU, bool UseOffsets)
 Emit the given unit to its section. More...
 
void emitAbbrevs (MCSection *)
 Emit a set of abbreviations to the specific section. More...
 
void emitStrings (MCSection *StrSection, MCSection *OffsetSection=nullptr, bool UseRelativeOffsets=false)
 Emit all of the strings to the section given. More...
 
DwarfStringPoolgetStringPool ()
 Returns the string pool. More...
 
MCSymbolgetStringOffsetsStartSym () const
 
void setStringOffsetsStartSym (MCSymbol *Sym)
 
MCSymbolgetRnglistsTableBaseSym () const
 
void setRnglistsTableBaseSym (MCSymbol *Sym)
 
bool addScopeVariable (LexicalScope *LS, DbgVariable *Var)
 
void addScopeLabel (LexicalScope *LS, DbgLabel *Label)
 
DenseMap< LexicalScope *, ScopeVars > & getScopeVariables ()
 
DenseMap< LexicalScope *, LabelList > & getScopeLabels ()
 
DenseMap< const MDNode *, DIE * > & getAbstractSPDies ()
 
DenseMap< const DINode *, std::unique_ptr< DbgEntity > > & getAbstractEntities ()
 
void insertDIE (const MDNode *TypeMD, DIE *Die)
 
DIEgetDIE (const MDNode *TypeMD)
 

Public Attributes

StringRef FileName
 object file name. More...
 
DWARFContextDwarf = nullptr
 source DWARF information. More...
 
AddressesMapAddresses = nullptr
 helpful address information(list of valid address ranges, relocations). More...
 
const std::vector< std::string > & Warnings
 warnings for object file. More...
 

Detailed Description

this class represents DWARF information for source file and it`s address map.

Definition at line 205 of file DWARFLinker.h.

Constructor & Destructor Documentation

◆ DwarfFile() [1/2]

llvm::DwarfFile::DwarfFile ( StringRef  Name,
DWARFContext Dwarf,
AddressesMap Addresses,
const std::vector< std::string > &  Warnings 
)
inline

Definition at line 207 of file DWARFLinker.h.

◆ DwarfFile() [2/2]

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

Definition at line 23 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 127 of file DwarfFile.cpp.

References llvm::AsmPrinter::createTempSymbol().

◆ addScopeLabel()

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

◆ addScopeVariable()

bool DwarfFile::addScopeVariable ( LexicalScope LS,
DbgVariable Var 
)
Returns
false if the variable was merged with a previous one.

Definition at line 104 of file DwarfFile.cpp.

References llvm::DbgVariable::addMMIEntry(), llvm::DILocalVariable::getArg(), llvm::DbgVariable::getVariable(), and llvm::AArch64CC::LS.

◆ addUnit()

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

Add a unit to the list of CUs.

Definition at line 26 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().

Referenced by computeSizeAndOffsetsForUnit().

◆ computeSizeAndOffsets()

void DwarfFile::computeSizeAndOffsets ( )

Compute the size and offset of all the DIEs.

Definition at line 60 of file DwarfFile.cpp.

References computeSizeAndOffsetsForUnit(), and llvm::empty().

◆ 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(), and llvm::DIEUnit::getUnitDie().

Referenced by computeSizeAndOffsets().

◆ emitAbbrevs()

void DwarfFile::emitAbbrevs ( MCSection Section)

Emit a set of abbreviations to the specific section.

Definition at line 96 of file DwarfFile.cpp.

References llvm::DIEAbbrevSet::Emit().

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

◆ 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 99 of file DwarfFile.cpp.

References llvm::DwarfStringPool::emit().

Referenced by computeIndexValue().

◆ 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 32 of file DwarfFile.cpp.

References emitUnit().

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

◆ getAbstractEntities()

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

Definition at line 168 of file DwarfFile.h.

◆ getAbstractSPDies()

DenseMap<const MDNode *, DIE *>& llvm::DwarfFile::getAbstractSPDies ( )
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 108 of file DwarfFile.h.

Referenced by emitRangeList(), and emitRnglistsTableHeader().

◆ getRnglistsTableBaseSym()

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

Definition at line 148 of file DwarfFile.h.

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

◆ getScopeLabels()

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

Definition at line 160 of file DwarfFile.h.

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

◆ getScopeVariables()

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

Definition at line 156 of file DwarfFile.h.

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

◆ getStringOffsetsStartSym()

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

◆ getStringPool()

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

Returns the string pool.

Definition at line 143 of file DwarfFile.h.

Referenced by llvm::DwarfUnit::addString(), llvm::DwarfDebug::endFunctionImpl(), and llvm::DwarfDebug::enterNonTypeUnitContext().

◆ getUnits()

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

Definition at line 100 of file DwarfFile.h.

References addRange().

◆ insertDIE()

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

◆ setRnglistsTableBaseSym()

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

Definition at line 149 of file DwarfFile.h.

References llvm::AArch64CC::LS.

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

◆ setStringOffsetsStartSym()

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

Definition at line 146 of file DwarfFile.h.

Member Data Documentation

◆ Addresses

AddressesMap* llvm::DwarfFile::Addresses = nullptr

helpful address information(list of valid address ranges, relocations).

Definition at line 217 of file DWARFLinker.h.

Referenced by llvm::patchStmtList(), and llvm::DWARFLinker::setObjectPrefixMap().

◆ Dwarf

DWARFContext* llvm::DwarfFile::Dwarf = nullptr

source DWARF information.

Definition at line 215 of file DWARFLinker.h.

◆ FileName

StringRef llvm::DwarfFile::FileName

object file name.

Definition at line 213 of file DWARFLinker.h.

Referenced by llvm::DWARFLinker::setObjectPrefixMap().

◆ Warnings

const std::vector<std::string>& llvm::DwarfFile::Warnings

warnings for object file.

Definition at line 219 of file DWARFLinker.h.


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