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

The helper class to build type name based on DIE properties. More...

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

Public Member Functions
SyntheticTypeNameBuilder (TypePool &TypePoolRef)
Error assignName (UnitEntryPairTy InputUnitEntryPair, std::optional< std::pair< size_t, size_t > > ChildIndex)
Create synthetic name for the specified DIE InputUnitEntryPair and assign created name to the DIE type info.
Protected Member Functions
void addArrayDimension (UnitEntryPairTy InputUnitEntryPair)
Add array type dimension.
Error addSignature (UnitEntryPairTy InputUnitEntryPair, bool addTemplateParameters)
Add signature( entry type plus type of parameters plus type of template parameters(if addTemplateParameters is true).
Error addParamNames (CompileUnit &CU, SmallVector< const DWARFDebugInfoEntry *, 20 > &FunctionParameters)
Add specified FunctionParameters to the built name.
Error addTemplateParamNames (CompileUnit &CU, SmallVector< const DWARFDebugInfoEntry *, 10 > &TemplateParameters)
Add specified TemplateParameters to the built name.
void addOrderedName (CompileUnit &CU, const DWARFDebugInfoEntry *DieEntry)
Add ordered name to the built name.
Error addReferencedODRDies (UnitEntryPairTy InputUnitEntryPair, bool AssignNameToTypeDescriptor, ArrayRef< dwarf::Attribute > ODRAttrs)
Analyze InputUnitEntryPair's ODR attributes and put names of the referenced type dies to the built name.
Error addParentName (UnitEntryPairTy &InputUnitEntryPair)
Add names of parent dies to the built name.
void addDieNameFromDeclFileAndDeclLine (UnitEntryPairTy &InputUnitEntryPair, bool &HasDeclFileName)
void addTypePrefix (const DWARFDebugInfoEntry *DieEntry)
Add type prefix to the built name.
Error addTypeName (UnitEntryPairTy InputUnitEntryPair, bool AddParentNames)
Add type name to the built name.
Error addDIETypeName (UnitEntryPairTy InputUnitEntryPair, std::optional< std::pair< size_t, size_t > > ChildIndex, bool AssignNameToTypeDescriptor)
Analyze InputUnitEntryPair for the type name and possibly assign built type name to the DIE's type info.
void addOrderedName (std::pair< size_t, size_t > ChildIdx)
Add ordered name to the built name.
void addValueName (UnitEntryPairTy InputUnitEntryPair, dwarf::Attribute Attr)
Add value name to the built name.
Protected Attributes
SmallString< 1000 > SyntheticName
Buffer keeping bult name.
size_t RecursionDepth = 0
Recursion counter.
TypePool & TypePoolRef
Type pool.

The helper class to build type name based on DIE properties.

It builds synthetic name based on explicit attributes: DW_AT_name, DW_AT_linkage_name or based on implicit attributes(DW_AT_decl*). Names for specific DIEs(like subprograms, template classes...) include additional attributes: subprogram parameters, template parameters, array ranges. Examples of built name:

class A { } : {8}A

namspace llvm { class A { } } : {1}llvm{8}A

template structure B { } : {F}B<{0}int>

void foo ( int p1, float p3 ) : {a}void foo({0}int, {0}int)

int *ptr; : {c}ptr {0}int

int var; : {d}var

These names is used to refer DIEs describing types.

Definition at line 46 of file SyntheticTypeNameBuilder.h.

llvm::dwarf_linker::parallel::SyntheticTypeNameBuilder::SyntheticTypeNameBuilder ( TypePool & TypePoolRef) inline

addArrayDimension()

void SyntheticTypeNameBuilder::addArrayDimension ( UnitEntryPairTy InputUnitEntryPair) protected

addDieNameFromDeclFileAndDeclLine()

void SyntheticTypeNameBuilder::addDieNameFromDeclFileAndDeclLine ( UnitEntryPairTy & InputUnitEntryPair, bool & HasDeclFileName ) protected

addDIETypeName()

Error SyntheticTypeNameBuilder::addDIETypeName ( UnitEntryPairTy InputUnitEntryPair, std::optional< std::pair< size_t, size_t > > ChildIndex, bool AssignNameToTypeDescriptor ) protected

Analyze InputUnitEntryPair for the type name and possibly assign built type name to the DIE's type info.

NOTE: while analyzing types we may create different kind of names for the same type depending on whether the type is part of another type. f.e. DW_TAG_formal_parameter would receive "{02}01" name when examined alone. Or "{0}int" name when it is a part of a function name: {a}void foo({0}int). The AssignNameToTypeDescriptor tells whether the type name is part of another type name and then should not be assigned to DIE type descriptor.

Definition at line 394 of file SyntheticTypeNameBuilder.cpp.

References addOrderedName(), addParentName(), addTypeName(), addTypePrefix(), llvm::dwarf_linker::parallel::UnitEntryPairTy::CU, llvm::dwarf_linker::parallel::UnitEntryPairTy::DieEntry, llvm::dwarf_linker::parallel::CompileUnit::getDieTypeEntry(), llvm::StringMapEntry< ValueTy >::getKey(), getTypeDeduplicationCandidate(), llvm::dwarf_linker::parallel::CompileUnit::setDieTypeEntry(), llvm::Error::success(), SyntheticName, and TypePoolRef.

Referenced by addParentName(), addReferencedODRDies(), and assignName().

addOrderedName() [1/2]

addOrderedName() [2/2]

void SyntheticTypeNameBuilder::addOrderedName ( std::pair< size_t, size_t > ChildIdx) protected

addParamNames()

addParentName()

addReferencedODRDies()

Analyze InputUnitEntryPair's ODR attributes and put names of the referenced type dies to the built name.

Definition at line 276 of file SyntheticTypeNameBuilder.cpp.

References addDIETypeName(), llvm::createStringError(), llvm::dwarf_linker::parallel::UnitEntryPairTy::CU, llvm::dwarf_linker::parallel::UnitEntryPairTy::DieEntry, llvm::dwarf_linker::parallel::CompileUnit::find(), RecursionDepth, llvm::dwarf_linker::parallel::Resolve, llvm::dwarf_linker::parallel::CompileUnit::resolveDIEReference(), llvm::Error::success(), and SyntheticName.

Referenced by addParamNames(), addSignature(), addTemplateParamNames(), and addTypeName().

addSignature()

Add signature( entry type plus type of parameters plus type of template parameters(if addTemplateParameters is true).

Definition at line 61 of file SyntheticTypeNameBuilder.cpp.

References addParamNames(), addReferencedODRDies(), addTemplateParamNames(), llvm::dwarf_linker::parallel::UnitEntryPairTy::CU, llvm::dwarf_linker::parallel::UnitEntryPairTy::DieEntry, llvm::DWARFDebugInfoEntry::getAbbreviationDeclarationPtr(), llvm::dwarf_linker::parallel::CompileUnit::getFirstChildEntry(), llvm::dwarf_linker::parallel::CompileUnit::getSiblingEntry(), llvm::SmallVectorTemplateBase< T, bool >::push_back(), llvm::Error::success(), SyntheticName, and TypeAttr.

Referenced by addTypeName().

addTemplateParamNames()

addTypeName()

Add type name to the built name.

Definition at line 314 of file SyntheticTypeNameBuilder.cpp.

References addArrayDimension(), addDieNameFromDeclFileAndDeclLine(), addReferencedODRDies(), addSignature(), addValueName(), llvm::dwarf_linker::parallel::UnitEntryPairTy::CU, llvm::dwarf_linker::parallel::UnitEntryPairTy::DieEntry, llvm::dwarf_linker::parallel::CompileUnit::find(), llvm::dwarf_linker::parallel::getODRAttributes(), llvm::DWARFDebugInfoEntry::getTag(), llvm::Error::success(), SyntheticName, and llvm::dwarf::toStringRef().

Referenced by addDIETypeName().

addTypePrefix()

addValueName()

assignName()

Error SyntheticTypeNameBuilder::assignName ( UnitEntryPairTy InputUnitEntryPair,
std::optional< std::pair< size_t, size_t > > ChildIndex )

RecursionDepth

size_t llvm::dwarf_linker::parallel::SyntheticTypeNameBuilder::RecursionDepth = 0 protected

SyntheticName

SmallString<1000> llvm::dwarf_linker::parallel::SyntheticTypeNameBuilder::SyntheticName protected

Buffer keeping bult name.

Definition at line 119 of file SyntheticTypeNameBuilder.h.

Referenced by addArrayDimension(), addDieNameFromDeclFileAndDeclLine(), addDIETypeName(), addOrderedName(), addParamNames(), addParentName(), addReferencedODRDies(), addSignature(), addTemplateParamNames(), addTypeName(), addTypePrefix(), addValueName(), and assignName().

TypePoolRef

TypePool& llvm::dwarf_linker::parallel::SyntheticTypeNameBuilder::TypePoolRef protected

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