LLVM API Documentation
Collects and handles dwarf debug information. More...
#include <DwarfDebug.h>
Public Member Functions | |
DwarfDebug (AsmPrinter *A, Module *M) | |
void | insertDIE (const MDNode *TypeMD, DIE *Die) |
DIE * | getDIE (const MDNode *TypeMD) |
void | beginModule () |
Emit all Dwarf sections that should come prior to the content. More... | |
void | endModule () |
Emit all Dwarf sections that should come after the content. More... | |
void | beginFunction (const MachineFunction *MF) |
Gather pre-function debug information. More... | |
void | endFunction (const MachineFunction *MF) |
Gather and emit post-function debug information. More... | |
void | beginInstruction (const MachineInstr *MI) |
Process beginning of an instruction. More... | |
void | endInstruction (const MachineInstr *MI) |
Process end of an instruction. More... | |
void | addTypeUnitType (DIE *Die) |
Add a DIE to the set of types that we're going to pull into type units. More... | |
void | addArangeLabel (SymbolCU SCU) |
Add a label so that arange data can be generated for it. More... | |
void | setSymbolSize (const MCSymbol *Sym, uint64_t Size) |
For symbols that have a size designated (e.g. common symbols), this tracks that size. More... | |
unsigned | getOrCreateSourceID (StringRef DirName, StringRef FullName, unsigned CUID) |
Look up the source id with the given directory and source file names. If none currently exists, create a new id and insert it in the SourceIds map. More... | |
void | emitDIE (DIE *Die, ArrayRef< DIEAbbrev * > Abbrevs) |
Recursively Emits a debug information entry. More... | |
bool | useDwarfAccelTables () |
Returns whether or not to emit tables that dwarf consumers can use to accelerate lookup. More... | |
bool | useSplitDwarf () |
Returns whether or not to change the current debug info for the split dwarf proposal support. More... | |
unsigned | getDwarfVersion () const |
Returns the Dwarf Version. More... | |
template<typename T > | |
T | resolve (DIRef< T > Ref) const |
Find the MDNode for the given reference. More... | |
bool | isSubprogramContext (const MDNode *Context) |
Collects and handles dwarf debug information.
Definition at line 313 of file DwarfDebug.h.
DwarfDebug::DwarfDebug | ( | AsmPrinter * | A, |
Module * | M | ||
) |
Definition at line 181 of file DwarfDebug.cpp.
References beginModule(), DbgTimerName, llvm::Reloc::Default, DwarfAccelTables, DWARFGroupName, DwarfPubSections, getDwarfVersionFromModule(), llvm::MachineModuleInfo::getModule(), llvm::AsmPrinter::getTargetTriple(), SplitDwarf, T, and llvm::TimePassesIsEnabled.
|
inline |
Add a label so that arange data can be generated for it.
Definition at line 701 of file DwarfDebug.h.
Referenced by llvm::CompileUnit::addLabelAddress(), and llvm::CompileUnit::addOpAddress().
|
inline |
Add a DIE to the set of types that we're going to pull into type units.
Definition at line 698 of file DwarfDebug.h.
void DwarfDebug::beginFunction | ( | const MachineFunction * | MF | ) |
Gather pre-function debug information.
Definition at line 1592 of file DwarfDebug.cpp.
References llvm::SmallVectorTemplateCommon< T >::back(), llvm::MachineFunction::back(), llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT >::begin(), llvm::MachineFunction::begin(), llvm::dbgs(), DEBUG, DWARF2_FLAG_IS_STMT, llvm::MCStreamer::EmitLabel(), llvm::SmallVectorBase::empty(), llvm::LexicalScopes::empty(), llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT >::empty(), llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT >::end(), llvm::MachineBasicBlock::end(), llvm::MachineFunction::end(), llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT >::find(), llvm::MachineInstr::FrameSetup, llvm::DebugLoc::getCol(), llvm::Function::getContext(), llvm::MCStreamer::getContext(), llvm::DIVariable::getContext(), llvm::LexicalScopes::getCurrentFunctionScope(), llvm::MachineInstr::getDebugLoc(), llvm::getDISubprogram(), llvm::MachineInstr::getFlag(), getFnDebugLoc(), llvm::MachineFunction::getFunction(), llvm::AsmPrinter::getFunctionNumber(), llvm::MachineBasicBlock::getLastNonDebugInstr(), llvm::DebugLoc::getLine(), llvm::MachineInstr::getNumOperands(), llvm::MCRegisterInfo::getNumRegs(), llvm::MachineInstr::getOperand(), llvm::MachineInstr::getParent(), llvm::MachineBasicBlock::getParent(), llvm::MachineOperand::getReg(), llvm::TargetMachine::getRegisterInfo(), llvm::DebugLoc::getScope(), llvm::LexicalScope::getScopeNode(), llvm::DIDescriptor::getTag(), llvm::AsmPrinter::GetTempSymbol(), llvm::CompileUnit::getUniqueID(), llvm::MachineModuleInfo::hasDebugInfo(), llvm::TargetMachine::hasMCUseLoc(), llvm::MCStreamer::hasRawTextSupport(), I, llvm::ARM_PROC::IE, llvm::LexicalScopes::initialize(), isDbgValueInDefinedReg(), llvm::MachineInstr::isDebugValue(), llvm::MachineInstr::isIdenticalTo(), llvm::MachineInstr::isLabel(), llvm::DebugLoc::isUnknown(), llvm::MCRegAliasIterator::isValid(), llvm::DIDescriptor::isVariable(), llvm::A64CC::MI, llvm::next(), llvm::MachineInstr::operands_begin(), llvm::MachineInstr::operands_end(), llvm::AsmPrinter::OutStreamer, llvm::SmallVectorTemplateBase< T, isPodLike< T >::value >::pop_back(), llvm::SmallVectorTemplateBase< T, isPodLike< T >::value >::push_back(), llvm::MCContext::setDwarfCompileUnitID(), llvm::SmallVectorTemplateCommon< T >::size(), and llvm::AsmPrinter::TM.
Referenced by llvm::AsmPrinter::EmitFunctionHeader().
void DwarfDebug::beginInstruction | ( | const MachineInstr * | MI | ) |
Process beginning of an instruction.
Definition at line 1467 of file DwarfDebug.cpp.
References llvm::MCContext::CreateTempSymbol(), DWARF2_FLAG_IS_STMT, DWARF2_FLAG_PROLOGUE_END, llvm::MCStreamer::EmitLabel(), llvm::DebugLoc::getCol(), llvm::Function::getContext(), llvm::MachineModuleInfo::getContext(), llvm::MachineInstr::getDebugLoc(), llvm::MachineFunction::getFunction(), llvm::DebugLoc::getLine(), llvm::DebugLoc::getScope(), I, llvm::MachineInstr::isDebugValue(), llvm::DebugLoc::isUnknown(), llvm::AsmPrinter::MF, llvm::AsmPrinter::OutStreamer, and UnknownLocations.
Referenced by llvm::AsmPrinter::EmitFunctionBody().
void DwarfDebug::beginModule | ( | ) |
Emit all Dwarf sections that should come prior to the content.
Definition at line 896 of file DwarfDebug.cpp.
References llvm::SmallVectorTemplateCommon< T, typename >::begin(), DisableDebugInfoPrinting, llvm::SmallVectorTemplateCommon< T, typename >::end(), llvm::generateDITypeIdentifierMap(), llvm::DIArray::getElement(), llvm::MachineModuleInfo::getModule(), llvm::Module::getNamedMetadata(), llvm::DIArray::getNumElements(), llvm::NamedMDNode::getNumOperands(), llvm::AsmPrinter::getObjFileLowering(), llvm::NamedMDNode::getOperand(), llvm::MCObjectFileInfo::getTextSection(), llvm::SmallVectorTemplateBase< T, isPodLike >::push_back(), and llvm::MachineModuleInfo::setDebugInfoAvailability().
Referenced by DwarfDebug().
Recursively Emits a debug information entry.
Definition at line 2041 of file DwarfDebug.cpp.
References llvm::dwarf::AccessibilityString(), llvm::MCStreamer::AddComment(), llvm::dwarf::AttributeString(), llvm::MCAsmInfo::doesDwarfUseRelocationsAcrossSections(), llvm::dwarf::DW_CHILDREN_yes, llvm::AsmPrinter::EmitInt32(), llvm::AsmPrinter::EmitInt8(), llvm::AsmPrinter::EmitLabelDifference(), llvm::AsmPrinter::EmitLabelOffsetDifference(), llvm::AsmPrinter::EmitLabelPlusOffset(), llvm::AsmPrinter::EmitSectionOffset(), llvm::AsmPrinter::EmitULEB128(), llvm::DIE::getAbbrevNumber(), llvm::DIE::getChildren(), llvm::DIEAbbrev::getChildrenFlag(), llvm::DIE::getCompileUnit(), llvm::DIEAbbrev::getData(), llvm::CompileUnit::getDebugInfoOffset(), llvm::DIEEntry::getEntry(), llvm::DIE::getOffset(), llvm::DIEEntry::getRefAddrSize(), llvm::DIE::getSize(), llvm::DIEAbbrev::getTag(), llvm::DIEInteger::getValue(), llvm::DIE::getValues(), llvm::AsmPrinter::isVerbose(), llvm::AsmPrinter::MAI, N, llvm::AsmPrinter::OutStreamer, llvm::SmallVectorTemplateCommon< T >::size(), llvm::Module::size(), llvm::dwarf::TagString(), useSplitDwarf(), and llvm::Twine::utohexstr().
Referenced by llvm::DwarfUnits::emitUnits().
void DwarfDebug::endFunction | ( | const MachineFunction * | MF | ) |
Gather and emit post-function debug information.
Definition at line 1819 of file DwarfDebug.cpp.
References llvm::CompileUnit::addFlag(), llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT >::begin(), llvm::cleanseInlinedVariable(), llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT >::clear(), llvm::DeleteContainerPointers(), llvm::TargetOptions::DisableFramePointerElim(), llvm::MCStreamer::EmitLabel(), llvm::LexicalScopes::empty(), llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT >::end(), llvm::LexicalScopes::findAbstractScope(), llvm::LexicalScopes::getAbstractScopesList(), llvm::MCStreamer::getContext(), llvm::DIVariable::getContext(), llvm::LexicalScopes::getCurrentFunctionScope(), llvm::DIArray::getElement(), llvm::AsmPrinter::getFunctionNumber(), llvm::DIArray::getNumElements(), llvm::LexicalScope::getScopeNode(), llvm::MachineFunction::getTarget(), llvm::AsmPrinter::GetTempSymbol(), llvm::DISubprogram::getVariables(), llvm::MachineModuleInfo::hasDebugInfo(), I, llvm::SmallPtrSet< PtrType, SmallSize >::insert(), llvm::DIDescriptor::isSubprogram(), llvm::DIDescriptor::isVariable(), llvm::TargetMachine::Options, llvm::AsmPrinter::OutStreamer, llvm::MCContext::setDwarfCompileUnitID(), and llvm::ArrayRef< T >::size().
Referenced by llvm::AsmPrinter::EmitFunctionBody().
void DwarfDebug::endInstruction | ( | const MachineInstr * | MI | ) |
Process end of an instruction.
Definition at line 1509 of file DwarfDebug.cpp.
References llvm::MCContext::CreateTempSymbol(), llvm::MCStreamer::EmitLabel(), llvm::MachineModuleInfo::getContext(), I, llvm::MachineInstr::isDebugValue(), and llvm::AsmPrinter::OutStreamer.
Referenced by llvm::AsmPrinter::EmitFunctionBody().
void DwarfDebug::endModule | ( | ) |
Emit all Dwarf sections that should come after the content.
Definition at line 1147 of file DwarfDebug.cpp.
References llvm::DwarfUnits::emitAddresses(), for(), GenerateGnuPubSections, llvm::MCObjectFileInfo::getDwarfAddrSection(), llvm::AsmPrinter::getObjFileLowering(), I, useDwarfAccelTables(), and useSplitDwarf().
Referenced by llvm::AsmPrinter::doFinalization().
Definition at line 673 of file DwarfDebug.h.
Referenced by llvm::CompileUnit::getDIE().
|
inline |
Returns the Dwarf Version.
Definition at line 727 of file DwarfDebug.h.
Referenced by llvm::CompileUnit::addFlag(), llvm::CompileUnit::constructVariableDIE(), llvm::CompileUnit::emitHeader(), and llvm::DIEEntry::getRefAddrSize().
Look up the source id with the given directory and source file names. If none currently exists, create a new id and insert it in the SourceIds map.
Definition at line 677 of file DwarfDebug.cpp.
References llvm::MCStreamer::EmitDwarfFileDirective(), llvm::StringRef::empty(), llvm::StringMapEntry< ValueTy >::getValue(), llvm::TargetMachine::hasMCUseLoc(), llvm::MCStreamer::hasRawTextSupport(), llvm::AsmPrinter::OutStreamer, llvm::AsmPrinter::TM, and llvm::utostr().
Referenced by llvm::CompileUnit::addSourceLine().
Definition at line 670 of file DwarfDebug.h.
Referenced by llvm::CompileUnit::insertDIE().
isSubprogramContext - Return true if Context is either a subprogram or another context nested inside a subprogram.
Definition at line 355 of file DwarfDebug.cpp.
References llvm::DIDescriptor::isSubprogram(), llvm::DIDescriptor::isType(), and resolve().
Referenced by llvm::CompileUnit::createGlobalVariableDIE().
Find the MDNode for the given reference.
Definition at line 730 of file DwarfDebug.h.
References llvm::DIRef< T >::resolve().
Referenced by getBaseTypeSize(), isSubprogramContext(), isTypeSigned(), isTypeUnitScoped(), and isUnsignedDIType().
|
inline |
For symbols that have a size designated (e.g. common symbols), this tracks that size.
Definition at line 705 of file DwarfDebug.h.
Referenced by llvm::AsmPrinter::EmitGlobalVariable().
|
inline |
Returns whether or not to emit tables that dwarf consumers can use to accelerate lookup.
Definition at line 720 of file DwarfDebug.h.
Referenced by endModule().
|
inline |
Returns whether or not to change the current debug info for the split dwarf proposal support.
Definition at line 724 of file DwarfDebug.h.
Referenced by llvm::CompileUnit::addLabelAddress(), llvm::CompileUnit::addOpAddress(), llvm::CompileUnit::addString(), llvm::CompileUnit::createGlobalVariableDIE(), emitDIE(), and endModule().