LLVM 22.0.0git
llvm::dwarf_linker::parallel::SectionDescriptor Struct Reference

This structure is used to keep data of the concrete section. More...

#include "DWARFLinker/Parallel/OutputSections.h"

Inheritance diagram for llvm::dwarf_linker::parallel::SectionDescriptor:
[legend]

Public Member Functions

 SectionDescriptor (DebugSectionKind SectionKind, LinkingGlobalData &GlobalData, dwarf::FormParams Format, llvm::endianness Endianess)
void clearAllSectionData ()
 Erase whole section content(data bits, list of patches).
void clearSectionContent ()
 Erase only section output data bits.
template<typename T>
void notePatchWithOffsetUpdate (const T &Patch, OffsetsPtrVector &PatchesOffsetsList)
 While creating patches, offsets to attributes may be partially unknown(because size of abbreviation number is unknown).
void setSizesForSectionCreatedByAsmPrinter ()
 Some sections are emitted using AsmPrinter.
StringRef getContents () override
 Returns section content.
void emitUnitLength (uint64_t Length)
 Emit unit length into the current section contents.
void maybeEmitDwarf64Mark ()
 Emit DWARF64 mark into the current section contents.
void emitOffset (uint64_t Val)
 Emit specified offset value into the current section contents.
void emitIntVal (uint64_t Val, unsigned Size)
 Emit specified integer value into the current section contents.
void emitString (dwarf::Form StringForm, const char *StringVal)
void emitBinaryData (llvm::StringRef Data)
void emitInplaceString (StringRef String)
 Emit specified inplace string value into the current section contents.
void emitStringPlaceholder ()
 Emit string placeholder into the current section contents.
void apply (uint64_t PatchOffset, dwarf::Form AttrForm, uint64_t Val)
 Write specified Value of AttrForm to the PatchOffset.
uint64_t getIntVal (uint64_t PatchOffset, unsigned Size)
 Returns integer value of Size located by specified PatchOffset.
Public Member Functions inherited from llvm::dwarf_linker::parallel::SectionDescriptorBase
 SectionDescriptorBase (DebugSectionKind SectionKind, dwarf::FormParams Format, llvm::endianness Endianess)
virtual ~SectionDescriptorBase ()=default
DebugSectionKind getKind ()
 Returns section kind.
const StringLiteralgetName () const
 Returns section name.
llvm::endianness getEndianess () const
 Returns endianess used by section.
dwarf::FormParams getFormParams () const
 Returns FormParams used by section.

Public Attributes

friend OutputSections
uint64_t StartOffset = 0
 When objects(f.e.
raw_svector_ostream OS
 Stream which stores data to the Contents.

Protected Member Functions

void applyIntVal (uint64_t PatchOffset, uint64_t Val, unsigned Size)
 Writes integer value Val of Size by specified PatchOffset.
void applyULEB128 (uint64_t PatchOffset, uint64_t Val)
 Writes integer value Val of ULEB128 format by specified PatchOffset.
void applySLEB128 (uint64_t PatchOffset, uint64_t Val)
 Writes integer value Val of SLEB128 format by specified PatchOffset.
void setOutputFormat (dwarf::FormParams Format, llvm::endianness Endianess)
 Sets output format.

Protected Attributes

OutSectionDataTy Contents
 Section data bits.
LinkingGlobalDataGlobalData
size_t SectionOffsetInsideAsmPrinterOutputStart = 0
 Some sections are generated using AsmPrinter.
size_t SectionOffsetInsideAsmPrinterOutputEnd = 0
Protected Attributes inherited from llvm::dwarf_linker::parallel::SectionDescriptorBase
DebugSectionKind SectionKind = DebugSectionKind::NumberOfEnumEntries
 The section kind.
dwarf::FormParams Format = {4, 4, dwarf::DWARF32}
 Output format.
llvm::endianness Endianess = llvm::endianness::little

Detailed Description

This structure is used to keep data of the concrete section.

Like data bits, list of patches, format.

Definition at line 152 of file OutputSections.h.

Constructor & Destructor Documentation

◆ SectionDescriptor()

Member Function Documentation

◆ apply()

◆ applyIntVal()

void SectionDescriptor::applyIntVal ( uint64_t PatchOffset,
uint64_t Val,
unsigned Size )
protected

Writes integer value Val of Size by specified PatchOffset.

Definition at line 249 of file OutputSections.cpp.

References assert(), data, llvm::dwarf_linker::parallel::SectionDescriptorBase::Endianess, getContents(), llvm_unreachable, Size, llvm::size(), and llvm::support::endian::write().

Referenced by apply().

◆ applySLEB128()

void SectionDescriptor::applySLEB128 ( uint64_t PatchOffset,
uint64_t Val )
protected

Writes integer value Val of SLEB128 format by specified PatchOffset.

Definition at line 291 of file OutputSections.cpp.

References assert(), data, llvm::encodeSLEB128(), llvm::dwarf_linker::parallel::SectionDescriptorBase::Format, getContents(), and llvm::size().

Referenced by apply().

◆ applyULEB128()

void SectionDescriptor::applyULEB128 ( uint64_t PatchOffset,
uint64_t Val )
protected

Writes integer value Val of ULEB128 format by specified PatchOffset.

Definition at line 279 of file OutputSections.cpp.

References assert(), data, llvm::encodeULEB128(), llvm::dwarf_linker::parallel::SectionDescriptorBase::Format, getContents(), and llvm::size().

Referenced by apply().

◆ clearAllSectionData()

void SectionDescriptor::clearAllSectionData ( )

Erase whole section content(data bits, list of patches).

Definition at line 59 of file OutputSections.cpp.

References clearSectionContent(), and StartOffset.

◆ clearSectionContent()

void SectionDescriptor::clearSectionContent ( )

Erase only section output data bits.

Definition at line 75 of file OutputSections.cpp.

References Contents.

Referenced by clearAllSectionData().

◆ emitBinaryData()

void SectionDescriptor::emitBinaryData ( llvm::StringRef Data)

Definition at line 166 of file OutputSections.cpp.

References llvm::Data, and OS.

◆ emitInplaceString()

void llvm::dwarf_linker::parallel::SectionDescriptor::emitInplaceString ( StringRef String)
inline

Emit specified inplace string value into the current section contents.

Definition at line 260 of file OutputSections.h.

References emitIntVal(), OS, and llvm::String.

Referenced by llvm::dwarf_linker::parallel::DwarfUnit::emitPubAcceleratorEntry(), and emitString().

◆ emitIntVal()

◆ emitOffset()

void llvm::dwarf_linker::parallel::SectionDescriptor::emitOffset ( uint64_t Val)
inline

◆ emitString()

void SectionDescriptor::emitString ( dwarf::Form StringForm,
const char * StringVal )

◆ emitStringPlaceholder()

void llvm::dwarf_linker::parallel::SectionDescriptor::emitStringPlaceholder ( )
inline

Emit string placeholder into the current section contents.

Definition at line 266 of file OutputSections.h.

References emitOffset().

Referenced by emitString().

◆ emitUnitLength()

void llvm::dwarf_linker::parallel::SectionDescriptor::emitUnitLength ( uint64_t Length)
inline

◆ getContents()

StringRef llvm::dwarf_linker::parallel::SectionDescriptor::getContents ( )
inlineoverridevirtual

◆ getIntVal()

uint64_t SectionDescriptor::getIntVal ( uint64_t PatchOffset,
unsigned Size )

◆ maybeEmitDwarf64Mark()

void llvm::dwarf_linker::parallel::SectionDescriptor::maybeEmitDwarf64Mark ( )
inline

◆ notePatchWithOffsetUpdate()

template<typename T>
void llvm::dwarf_linker::parallel::SectionDescriptor::notePatchWithOffsetUpdate ( const T & Patch,
OffsetsPtrVector & PatchesOffsetsList )
inline

While creating patches, offsets to attributes may be partially unknown(because size of abbreviation number is unknown).

In such case we remember patch itself and pointer to patch application offset to add size of abbreviation number later.

Definition at line 215 of file OutputSections.h.

References llvm::SmallVectorImpl< T >::emplace_back(), and T.

Referenced by llvm::dwarf_linker::parallel::TypeUnit::createDIETree().

◆ setOutputFormat()

void llvm::dwarf_linker::parallel::SectionDescriptor::setOutputFormat ( dwarf::FormParams Format,
llvm::endianness Endianess )
inlineprotected

◆ setSizesForSectionCreatedByAsmPrinter()

Member Data Documentation

◆ Contents

OutSectionDataTy llvm::dwarf_linker::parallel::SectionDescriptor::Contents
protected

Section data bits.

Definition at line 186 of file OutputSections.h.

Referenced by clearSectionContent(), getContents(), SectionDescriptor(), and setSizesForSectionCreatedByAsmPrinter().

◆ GlobalData

LinkingGlobalData& llvm::dwarf_linker::parallel::SectionDescriptor::GlobalData
protected

Definition at line 293 of file OutputSections.h.

Referenced by emitString(), and SectionDescriptor().

◆ OS

◆ OutputSections

friend llvm::dwarf_linker::parallel::SectionDescriptor::OutputSections

Definition at line 153 of file OutputSections.h.

◆ SectionOffsetInsideAsmPrinterOutputEnd

size_t llvm::dwarf_linker::parallel::SectionDescriptor::SectionOffsetInsideAsmPrinterOutputEnd = 0
protected

Definition at line 299 of file OutputSections.h.

Referenced by getContents(), and setSizesForSectionCreatedByAsmPrinter().

◆ SectionOffsetInsideAsmPrinterOutputStart

size_t llvm::dwarf_linker::parallel::SectionDescriptor::SectionOffsetInsideAsmPrinterOutputStart = 0
protected

Some sections are generated using AsmPrinter.

The real section data located inside elf file in that case. Following fields points to the real section content inside elf file.

Definition at line 298 of file OutputSections.h.

Referenced by getContents(), and setSizesForSectionCreatedByAsmPrinter().

◆ StartOffset

uint64_t llvm::dwarf_linker::parallel::SectionDescriptor::StartOffset = 0

When objects(f.e.

compile units) are glued into the single file, the debug sections corresponding to the concrete object are assigned with offsets inside the whole file. This field keeps offset to the debug section, corresponding to this object.

Definition at line 182 of file OutputSections.h.

Referenced by llvm::dwarf_linker::parallel::OutputSections::applyPatches(), and clearAllSectionData().


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