LLVM: llvm::dwarf_linker::parallel::OutputSections Class Reference (original) (raw)

This class keeps contents and offsets to the debug sections. More...

#include "[DWARFLinker/Parallel/OutputSections.h](OutputSections%5F8h%5Fsource.html)"

Public Member Functions
OutputSections (LinkingGlobalData &GlobalData)
void setOutputFormat (dwarf::FormParams Format, llvm::endianness Endianness)
Sets output format for all keeping sections.
const SectionDescriptor & getSectionDescriptor (DebugSectionKind SectionKind) const
Returns descriptor for the specified section of SectionKind.
SectionDescriptor & getSectionDescriptor (DebugSectionKind SectionKind)
Returns descriptor for the specified section of SectionKind.
std::optional< const SectionDescriptor * > tryGetSectionDescriptor (DebugSectionKind SectionKind) const
Returns descriptor for the specified section of SectionKind.
std::optional< SectionDescriptor * > tryGetSectionDescriptor (DebugSectionKind SectionKind)
Returns descriptor for the specified section of SectionKind.
SectionDescriptor & getOrCreateSectionDescriptor (DebugSectionKind SectionKind)
Returns descriptor for the specified section of SectionKind.
void eraseSections ()
Erases data of all sections.
void forEach (function_ref< void(SectionDescriptor &)> Handler)
Enumerate all sections and call Handler for each.
void forEach (function_ref< void(std::shared_ptr< SectionDescriptor > Section)> Handler)
Enumerate all sections and call Handler for each.
void assignSectionsOffsetAndAccumulateSize (std::array< uint64_t, SectionKindsNum > &SectionSizesAccumulator)
Enumerate all sections, for each section set current offset (kept by SectionSizesAccumulator), update current offset with section length.
void applyPatches (SectionDescriptor &Section, StringEntryToDwarfStringPoolEntryMap &DebugStrStrings, StringEntryToDwarfStringPoolEntryMap &DebugLineStrStrings, TypeUnit *TypeUnitPtr)
Enumerate all sections, for each section apply all section patches.
llvm::endianness getEndianness () const
Endiannes for the sections.
uint16_t getVersion () const
Return DWARF version.
uint16_t getDebugInfoHeaderSize () const
Return size of header of debug_info table.
uint16_t getDebugAddrHeaderSize () const
Return size of header of debug_ table.
uint16_t getDebugStrOffsetsHeaderSize () const
Return size of header of debug_str_offsets table.
const dwarf::FormParams & getFormParams () const
Return size of address.
Protected Types
using SectionsSetTy
All keeping sections.
Protected Attributes
LinkingGlobalData & GlobalData
dwarf::FormParams Format = {4, 4, dwarf::DWARF32}
Format for sections.
llvm::endianness Endianness = llvm::endianness::native
Endiannes for sections.
SectionsSetTy SectionDescriptors

This class keeps contents and offsets to the debug sections.

Any objects which is supposed to be emitted into the debug sections should use this class to track debug sections offsets and keep sections data.

Definition at line 305 of file OutputSections.h.

SectionsSetTy

Initial value:

std::map<DebugSectionKind, std::shared_ptr>

All keeping sections.

Definition at line 462 of file OutputSections.h.

llvm::dwarf_linker::parallel::OutputSections::OutputSections ( LinkingGlobalData & GlobalData) inline

applyPatches()

Enumerate all sections, for each section apply all section patches.

Definition at line 302 of file OutputSections.cpp.

References assert(), llvm::dwarf_linker::DebugInfo, llvm::dwarf_linker::DebugLoc, llvm::dwarf_linker::DebugLocLists, llvm::dwarf_linker::DebugRange, llvm::dwarf_linker::DebugRngLists, Format, llvm::formatv(), llvm::dwarf_linker::parallel::StringEntryToDwarfStringPoolEntryMap::getExistingEntry(), llvm::dwarf_linker::parallel::TypeEntryBody::getFinalDie(), llvm::DIE::getOffset(), llvm::getULEB128Size(), llvm::dwarf_linker::parallel::SectionPatch::PatchOffset, llvm::dwarf_linker::parallel::SectionDescriptor::StartOffset, llvm::dwarf_linker::parallel::DebugStrPatch::String, and tryGetSectionDescriptor().

Referenced by llvm::dwarf_linker::parallel::DWARFLinkerImpl::patchOffsetsAndSizes().

assignSectionsOffsetAndAccumulateSize()

void llvm::dwarf_linker::parallel::OutputSections::assignSectionsOffsetAndAccumulateSize ( std::array< uint64_t, SectionKindsNum > & SectionSizesAccumulator) inline

eraseSections()

void llvm::dwarf_linker::parallel::OutputSections::eraseSections ( ) inline

forEach() [1/2]

forEach() [2/2]

getDebugAddrHeaderSize()

uint16_t llvm::dwarf_linker::parallel::OutputSections::getDebugAddrHeaderSize ( ) const inline

getDebugInfoHeaderSize()

uint16_t llvm::dwarf_linker::parallel::OutputSections::getDebugInfoHeaderSize ( ) const inline

getDebugStrOffsetsHeaderSize()

uint16_t llvm::dwarf_linker::parallel::OutputSections::getDebugStrOffsetsHeaderSize ( ) const inline

getEndianness()

llvm::endianness llvm::dwarf_linker::parallel::OutputSections::getEndianness ( ) const inline

getFormParams()

getOrCreateSectionDescriptor()

Returns descriptor for the specified section of [SectionKind](classllvm%5F1%5F1SectionKind.html "SectionKind - This is a simple POD value that classifies the properties of a section.").

If descriptor does not exist then creates it.

Definition at line 375 of file OutputSections.h.

References Endianness, Format, GlobalData, and SectionDescriptors.

Referenced by llvm::dwarf_linker::parallel::CompileUnit::cloneAndEmit(), llvm::dwarf_linker::parallel::DWARFLinkerImpl::LinkContext::cloneAndEmitDebugFrame(), llvm::dwarf_linker::parallel::CompileUnit::CompileUnit(), llvm::dwarf_linker::parallel::CompileUnit::CompileUnit(), llvm::dwarf_linker::parallel::TypeUnit::createDIETree(), llvm::dwarf_linker::parallel::DwarfUnit::emitAbbreviations(), llvm::dwarf_linker::parallel::DwarfUnit::emitDebugInfo(), llvm::dwarf_linker::parallel::DwarfUnit::emitDebugStringOffsetSection(), llvm::dwarf_linker::parallel::DWARFLinkerImpl::LinkContext::emitInvariantSections(), llvm::dwarf_linker::parallel::DwarfUnit::emitPubAcceleratorEntry(), llvm::dwarf_linker::parallel::DwarfUnit::emitPubAccelerators(), llvm::dwarf_linker::parallel::TypeUnit::finishCloningAndEmit(), and llvm::dwarf_linker::parallel::TypeUnit::TypeUnit().

getSectionDescriptor() [1/2]

getSectionDescriptor() [2/2]

getVersion()

uint16_t llvm::dwarf_linker::parallel::OutputSections::getVersion ( ) const inline

setOutputFormat()

tryGetSectionDescriptor() [1/2]

tryGetSectionDescriptor() [2/2]

Endianness

Format

Format for sections.

Definition at line 456 of file OutputSections.h.

Referenced by applyPatches(), llvm::dwarf_linker::parallel::CompileUnit::CompileUnit(), llvm::dwarf_linker::parallel::CompileUnit::CompileUnit(), getDebugAddrHeaderSize(), getDebugInfoHeaderSize(), getDebugStrOffsetsHeaderSize(), getFormParams(), getOrCreateSectionDescriptor(), getVersion(), setOutputFormat(), and llvm::dwarf_linker::parallel::TypeUnit::TypeUnit().

GlobalData

Definition at line 453 of file OutputSections.h.

Referenced by llvm::dwarf_linker::parallel::CompileUnit::analyzeImportedModule(), llvm::dwarf_linker::parallel::CompileUnit::cloneAndEmit(), llvm::dwarf_linker::parallel::DWARFLinkerImpl::LinkContext::cloneAndEmitDebugFrame(), llvm::dwarf_linker::parallel::CompileUnit::CompileUnit(), llvm::dwarf_linker::parallel::CompileUnit::CompileUnit(), llvm::dwarf_linker::parallel::TypeUnit::createDIETree(), llvm::dwarf_linker::parallel::DwarfUnit::DwarfUnit(), llvm::dwarf_linker::parallel::DWARFLinkerImpl::LinkContext::emitInvariantSections(), llvm::dwarf_linker::parallel::CompileUnit::error(), llvm::dwarf_linker::parallel::CompileUnit::error(), llvm::dwarf_linker::parallel::DwarfUnit::error(), llvm::dwarf_linker::parallel::TypeUnit::finishCloningAndEmit(), llvm::dwarf_linker::parallel::DwarfUnit::getGlobalData(), getOrCreateSectionDescriptor(), llvm::dwarf_linker::parallel::DWARFLinkerImpl::LinkContext::isClangModuleRef(), llvm::dwarf_linker::parallel::DWARFLinkerImpl::LinkContext::link(), llvm::dwarf_linker::parallel::DWARFLinkerImpl::LinkContext::LinkContext(), llvm::dwarf_linker::parallel::DWARFLinkerImpl::LinkContext::linkSingleCompileUnit(), llvm::dwarf_linker::parallel::DWARFLinkerImpl::LinkContext::loadClangModule(), OutputSections(), llvm::dwarf_linker::parallel::DWARFLinkerImpl::LinkContext::registerModuleReference(), llvm::dwarf_linker::parallel::TypeUnit::TypeUnit(), llvm::dwarf_linker::parallel::CompileUnit::warn(), llvm::dwarf_linker::parallel::CompileUnit::warn(), llvm::dwarf_linker::parallel::CompileUnit::warn(), and llvm::dwarf_linker::parallel::DwarfUnit::warn().

SectionDescriptors

SectionsSetTy llvm::dwarf_linker::parallel::OutputSections::SectionDescriptors protected

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