LLVM API Documentation
Collects and handles information specific to a particular collection of units. More...
#include <DwarfDebug.h>
Public Member Functions | |
DwarfUnits (AsmPrinter *AP, FoldingSet< DIEAbbrev > *AS, std::vector< DIEAbbrev * > &A, const char *Pref, BumpPtrAllocator &DA) | |
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... | |
void | assignAbbrevNumber (DIEAbbrev &Abbrev) |
Define a unique number for the abbreviation. More... | |
void | addUnit (CompileUnit *CU) |
Add a unit to the list of CUs. More... | |
void | emitUnits (DwarfDebug *DD, const MCSection *USection, const MCSection *ASection, const MCSymbol *ASectionSym) |
Emit all of the units to the section listed with the given abbreviation section. More... | |
void | emitStrings (const MCSection *StrSection, const MCSection *OffsetSection, const MCSymbol *StrSecSym) |
Emit all of the strings to the section given. More... | |
void | emitAddresses (const MCSection *AddrSection) |
Emit all of the addresses to the section given. More... | |
MCSymbol * | getStringPoolSym () |
Returns the entry into the start of the pool. More... | |
MCSymbol * | getStringPoolEntry (StringRef Str) |
Returns an entry into the string pool with the given string text. More... | |
unsigned | getStringPoolIndex (StringRef Str) |
Returns the index into the string pool with the given string text. More... | |
StrPool * | getStringPool () |
Returns the string pool. More... | |
unsigned | getAddrPoolIndex (const MCExpr *Sym) |
Returns the index into the address pool with the given label/symbol. More... | |
unsigned | getAddrPoolIndex (const MCSymbol *Sym) |
AddrPool * | getAddrPool () |
Returns the address pool. More... | |
Collects and handles information specific to a particular collection of units.
Definition at line 221 of file DwarfDebug.h.
|
inline |
Definition at line 251 of file DwarfDebug.h.
|
inline |
Add a unit to the list of CUs.
Definition at line 268 of file DwarfDebug.h.
void DwarfUnits::assignAbbrevNumber | ( | DIEAbbrev & | Abbrev | ) |
Define a unique number for the abbreviation.
Definition at line 275 of file DwarfDebug.cpp.
References llvm::DIEAbbrev::getNumber(), and llvm::DIEAbbrev::setNumber().
Referenced by computeSizeAndOffset().
Compute the size and offset of a DIE given an incoming Offset.
Definition at line 1928 of file DwarfDebug.cpp.
References assignAbbrevNumber(), llvm::dwarf::DW_CHILDREN_yes, llvm::DIE::getAbbrev(), llvm::DIE::getAbbrevNumber(), llvm::DIE::getChildren(), llvm::DIEAbbrev::getChildrenFlag(), llvm::DIEAbbrev::getData(), llvm::DIE::getOffset(), llvm::MCAsmInfo::getULEB128Size(), llvm::DIE::getValues(), N, llvm::DIE::setOffset(), llvm::DIE::setSize(), llvm::SmallVectorTemplateCommon< T >::size(), and llvm::Module::size().
Referenced by computeSizeAndOffsets().
void DwarfUnits::computeSizeAndOffsets | ( | ) |
Compute the size and offset of all the DIEs.
Definition at line 1970 of file DwarfDebug.cpp.
References computeSizeAndOffset(), and I.
void DwarfUnits::emitAddresses | ( | const MCSection * | AddrSection | ) |
Emit all of the addresses to the section given.
Definition at line 2619 of file DwarfDebug.cpp.
References llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT >::begin(), llvm::MCStreamer::EmitIntValue(), llvm::MCStreamer::EmitValue(), llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT >::empty(), llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT >::end(), for(), llvm::AsmPrinter::getDataLayout(), llvm::DataLayout::getPointerSize(), I, llvm::AsmPrinter::OutStreamer, llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT >::size(), and llvm::MCStreamer::SwitchSection().
Referenced by llvm::DwarfDebug::endModule().
void DwarfUnits::emitStrings | ( | const MCSection * | StrSection, |
const MCSection * | OffsetSection = NULL , |
||
const MCSymbol * | StrSecSym = NULL |
||
) |
Emit all of the strings to the section given.
Definition at line 2576 of file DwarfDebug.cpp.
References llvm::array_pod_sort(), llvm::MCStreamer::EmitBytes(), llvm::MCStreamer::EmitIntValue(), llvm::MCStreamer::EmitLabel(), llvm::StringPool::empty(), I, llvm::AsmPrinter::OutStreamer, and llvm::MCStreamer::SwitchSection().
void DwarfUnits::emitUnits | ( | DwarfDebug * | DD, |
const MCSection * | USection, | ||
const MCSection * | ASection, | ||
const MCSymbol * | ASectionSym | ||
) |
Emit all of the units to the section listed with the given abbreviation section.
Definition at line 2156 of file DwarfDebug.cpp.
References llvm::MCStreamer::AddComment(), llvm::DwarfDebug::emitDIE(), llvm::CompileUnit::emitHeader(), llvm::AsmPrinter::EmitInt32(), llvm::MCStreamer::EmitLabel(), llvm::CompileUnit::getCUDie(), llvm::CompileUnit::getHeaderSize(), llvm::MCSection::getLabelBeginName(), llvm::MCSection::getLabelEndName(), llvm::DIE::getSize(), llvm::AsmPrinter::GetTempSymbol(), llvm::CompileUnit::getUniqueID(), I, llvm::AsmPrinter::OutStreamer, and llvm::MCStreamer::SwitchSection().
|
inline |
Returns the address pool.
Definition at line 302 of file DwarfDebug.h.
Returns the index into the address pool with the given label/symbol.
Definition at line 265 of file DwarfDebug.cpp.
References llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT >::insert(), and P.
Referenced by llvm::CompileUnit::addLabelAddress(), llvm::CompileUnit::addOpAddress(), llvm::CompileUnit::createGlobalVariableDIE(), and getAddrPoolIndex().
Definition at line 261 of file DwarfDebug.cpp.
References llvm::MCSymbolRefExpr::Create(), getAddrPoolIndex(), and llvm::AsmPrinter::OutContext.
|
inline |
Returns the string pool.
Definition at line 294 of file DwarfDebug.h.
Returns an entry into the string pool with the given string text.
Definition at line 242 of file DwarfDebug.cpp.
References llvm::AsmPrinter::GetTempSymbol().
Referenced by llvm::CompileUnit::addAccelName(), llvm::CompileUnit::addAccelNamespace(), llvm::CompileUnit::addAccelObjC(), llvm::CompileUnit::addAccelType(), llvm::CompileUnit::addLocalString(), and llvm::CompileUnit::addString().
Returns the index into the string pool with the given string text.
Definition at line 251 of file DwarfDebug.cpp.
References llvm::AsmPrinter::GetTempSymbol().
Referenced by llvm::CompileUnit::addString().
MCSymbol * DwarfUnits::getStringPoolSym | ( | ) |
Returns the entry into the start of the pool.
Definition at line 238 of file DwarfDebug.cpp.
References llvm::AsmPrinter::GetTempSymbol().
Referenced by llvm::CompileUnit::addLocalString(), and llvm::CompileUnit::addString().