LLVM 20.0.0git
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
llvm::dwarf_linker::parallel::DIEGenerator Class Reference

This class is a helper to create output DIE tree. More...

#include "DWARFLinker/Parallel/DIEGenerator.h"

Public Member Functions

 DIEGenerator (BumpPtrAllocator &Allocator, DwarfUnit &CU)
 
 DIEGenerator (DIE *OutputDIE, BumpPtrAllocator &Allocator, DwarfUnit &CU)
 
DIEcreateDIE (dwarf::Tag DieTag, uint32_t OutOffset)
 Creates a DIE of specified tag DieTag and OutOffset.
 
DIEgetDIE ()
 
void addChild (DIE *Child)
 Adds a specified Child to the current DIE.
 
std::pair< DIEValue &, size_t > addScalarAttribute (dwarf::Attribute Attr, dwarf::Form AttrForm, uint64_t Value)
 Adds specified scalar attribute to the current DIE.
 
std::pair< DIEValue &, size_t > addLocationAttribute (dwarf::Attribute Attr, dwarf::Form AttrForm, ArrayRef< uint8_t > Bytes)
 Adds specified location attribute to the current DIE.
 
std::pair< DIEValue &, size_t > addBlockAttribute (dwarf::Attribute Attr, dwarf::Form AttrForm, ArrayRef< uint8_t > Bytes)
 Adds specified block or exprloc attribute to the current DIE.
 
std::pair< DIEValue &, size_t > addLocListAttribute (dwarf::Attribute Attr, dwarf::Form AttrForm, uint64_t Value)
 Adds specified location list attribute to the current DIE.
 
std::pair< DIEValue &, size_t > addIndexedStringAttribute (dwarf::Attribute Attr, dwarf::Form AttrForm, uint64_t Idx)
 Adds indexed string attribute.
 
std::pair< DIEValue &, size_t > addStringPlaceholderAttribute (dwarf::Attribute Attr, dwarf::Form AttrForm)
 Adds string attribute with dummy offset to the current DIE.
 
std::pair< DIEValue &, size_t > addInplaceString (dwarf::Attribute Attr, StringRef String)
 Adds inplace string attribute to the current DIE.
 
size_t finalizeAbbreviations (bool CHILDREN_yes, OffsetsPtrVector *OffsetsList)
 Creates appreviations for the current DIE.
 

Protected Member Functions

template<typename T >
std::pair< DIEValue &, size_t > addAttribute (dwarf::Attribute Attr, dwarf::Form AttrForm, T &&Value)
 

Protected Attributes

BumpPtrAllocatorAllocator
 
DwarfUnitCU
 
DIEOutputDIE = nullptr
 

Detailed Description

This class is a helper to create output DIE tree.

Definition at line 22 of file DIEGenerator.h.

Constructor & Destructor Documentation

◆ DIEGenerator() [1/2]

llvm::dwarf_linker::parallel::DIEGenerator::DIEGenerator ( BumpPtrAllocator Allocator,
DwarfUnit CU 
)
inline

Definition at line 24 of file DIEGenerator.h.

◆ DIEGenerator() [2/2]

llvm::dwarf_linker::parallel::DIEGenerator::DIEGenerator ( DIE OutputDIE,
BumpPtrAllocator Allocator,
DwarfUnit CU 
)
inline

Definition at line 27 of file DIEGenerator.h.

Member Function Documentation

◆ addAttribute()

template<typename T >
std::pair< DIEValue &, size_t > llvm::dwarf_linker::parallel::DIEGenerator::addAttribute ( dwarf::Attribute  Attr,
dwarf::Form  AttrForm,
T &&  Value 
)
inlineprotected

◆ addBlockAttribute()

std::pair< DIEValue &, size_t > llvm::dwarf_linker::parallel::DIEGenerator::addBlockAttribute ( dwarf::Attribute  Attr,
dwarf::Form  AttrForm,
ArrayRef< uint8_t >  Bytes 
)
inline

Adds specified block or exprloc attribute to the current DIE.

Definition at line 71 of file DIEGenerator.h.

References addAttribute(), Allocator, assert(), llvm::Block, and llvm::ArrayRef< T >::size().

Referenced by llvm::dwarf_linker::parallel::DIEAttributeCloner::cloneBlockAttr().

◆ addChild()

void llvm::dwarf_linker::parallel::DIEGenerator::addChild ( DIE Child)
inline

Adds a specified Child to the current DIE.

Definition at line 42 of file DIEGenerator.h.

References llvm::DIE::addChild(), assert(), and OutputDIE.

Referenced by llvm::dwarf_linker::parallel::CompileUnit::cloneDIE().

◆ addIndexedStringAttribute()

std::pair< DIEValue &, size_t > llvm::dwarf_linker::parallel::DIEGenerator::addIndexedStringAttribute ( dwarf::Attribute  Attr,
dwarf::Form  AttrForm,
uint64_t  Idx 
)
inline

Adds indexed string attribute.

Definition at line 100 of file DIEGenerator.h.

References addAttribute(), assert(), and Idx.

Referenced by llvm::dwarf_linker::parallel::DIEAttributeCloner::cloneStringAttr().

◆ addInplaceString()

std::pair< DIEValue &, size_t > llvm::dwarf_linker::parallel::DIEGenerator::addInplaceString ( dwarf::Attribute  Attr,
StringRef  String 
)
inline

Adds inplace string attribute to the current DIE.

Definition at line 116 of file DIEGenerator.h.

References llvm::DIEValueList::addValue(), Allocator, llvm::Block, OutputDIE, and llvm::String.

◆ addLocationAttribute()

std::pair< DIEValue &, size_t > llvm::dwarf_linker::parallel::DIEGenerator::addLocationAttribute ( dwarf::Attribute  Attr,
dwarf::Form  AttrForm,
ArrayRef< uint8_t >  Bytes 
)
inline

Adds specified location attribute to the current DIE.

Definition at line 57 of file DIEGenerator.h.

References addAttribute(), Allocator, llvm::DIELoc::setSize(), and llvm::ArrayRef< T >::size().

Referenced by llvm::dwarf_linker::parallel::DIEAttributeCloner::cloneBlockAttr().

◆ addLocListAttribute()

std::pair< DIEValue &, size_t > llvm::dwarf_linker::parallel::DIEGenerator::addLocListAttribute ( dwarf::Attribute  Attr,
dwarf::Form  AttrForm,
uint64_t  Value 
)
inline

Adds specified location list attribute to the current DIE.

Definition at line 93 of file DIEGenerator.h.

References addAttribute().

Referenced by llvm::dwarf_linker::parallel::DIEAttributeCloner::cloneScalarAttr().

◆ addScalarAttribute()

std::pair< DIEValue &, size_t > llvm::dwarf_linker::parallel::DIEGenerator::addScalarAttribute ( dwarf::Attribute  Attr,
dwarf::Form  AttrForm,
uint64_t  Value 
)
inline

◆ addStringPlaceholderAttribute()

std::pair< DIEValue &, size_t > llvm::dwarf_linker::parallel::DIEGenerator::addStringPlaceholderAttribute ( dwarf::Attribute  Attr,
dwarf::Form  AttrForm 
)
inline

Adds string attribute with dummy offset to the current DIE.

Definition at line 109 of file DIEGenerator.h.

References addAttribute(), and assert().

Referenced by llvm::dwarf_linker::parallel::DIEAttributeCloner::cloneStringAttr(), and llvm::dwarf_linker::parallel::TypeUnit::createDIETree().

◆ createDIE()

DIE * llvm::dwarf_linker::parallel::DIEGenerator::createDIE ( dwarf::Tag  DieTag,
uint32_t  OutOffset 
)
inline

Creates a DIE of specified tag DieTag and OutOffset.

Definition at line 31 of file DIEGenerator.h.

References Allocator, llvm::DIE::get(), OutputDIE, and llvm::DIE::setOffset().

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

◆ finalizeAbbreviations()

size_t llvm::dwarf_linker::parallel::DIEGenerator::finalizeAbbreviations ( bool  CHILDREN_yes,
OffsetsPtrVector OffsetsList 
)
inline

Creates appreviations for the current DIE.

Returns value of abbreviation number. Updates offsets with the size of abbreviation number.

Definition at line 137 of file DIEGenerator.h.

References llvm::dwarf::DW_CHILDREN_yes, llvm::DIE::generateAbbrev(), llvm::DIE::getAbbrevNumber(), llvm::DIEAbbrev::getNumber(), llvm::getULEB128Size(), OutputDIE, llvm::DIE::setAbbrevNumber(), and llvm::DIEAbbrev::setChildrenFlag().

Referenced by llvm::dwarf_linker::parallel::DIEAttributeCloner::finalizeAbbreviations().

◆ getDIE()

DIE * llvm::dwarf_linker::parallel::DIEGenerator::getDIE ( )
inline

Definition at line 39 of file DIEGenerator.h.

References OutputDIE.

Member Data Documentation

◆ Allocator

BumpPtrAllocator& llvm::dwarf_linker::parallel::DIEGenerator::Allocator
protected

◆ CU

DwarfUnit& llvm::dwarf_linker::parallel::DIEGenerator::CU
protected

Definition at line 172 of file DIEGenerator.h.

◆ OutputDIE

DIE* llvm::dwarf_linker::parallel::DIEGenerator::OutputDIE = nullptr
protected

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