9#ifndef LLVM_LIB_DWARFLINKER_PARALLEL_DIEGENERATOR_H
10#define LLVM_LIB_DWARFLINKER_PARALLEL_DIEGENERATOR_H
61 for (
auto Byte : Bytes)
76 assert((AttrForm == dwarf::DW_FORM_block) ||
77 (AttrForm == dwarf::DW_FORM_exprloc) ||
78 (AttrForm == dwarf::DW_FORM_block1 && Bytes.
size() <= UINT8_MAX) ||
79 (AttrForm == dwarf::DW_FORM_block2 && Bytes.
size() <= UINT16_MAX) ||
80 (AttrForm == dwarf::DW_FORM_block4 && Bytes.
size() <= UINT32_MAX));
83 for (
auto Byte : Bytes)
103 assert(AttrForm == dwarf::DW_FORM_strx);
108 std::pair<DIEValue &, size_t>
110 assert(AttrForm == dwarf::DW_FORM_strp ||
111 AttrForm == dwarf::DW_FORM_line_strp);
119 for (
auto Byte :
String.bytes())
131 return std::pair<DIEValue &, size_t>(ValueRef,
String.size() + 1);
144 CU.assignAbbrev(NewAbbrev);
150 if (OffsetsList !=
nullptr) {
151 for (
uint64_t *OffsetPtr : *OffsetsList)
152 *OffsetPtr += AbbrevNumberSize;
155 return AbbrevNumberSize;
159 template <
typename T>
164 unsigned ValueSize = ValueRef.
sizeOf(
CU.getFormParams());
165 return std::pair<DIEValue &, size_t>(ValueRef, ValueSize);
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
size_t size() const
size - Get the array size.
Dwarf abbreviation, describes the organization of a debug information object.
unsigned getNumber() const
void setChildrenFlag(bool hasChild)
DIEBlock - Represents a block of values.
Represents a pointer to a location list in the debug_loc section.
DIELoc - Represents an expression location.
LLVM_ABI unsigned sizeOf(const dwarf::FormParams &FormParams) const
Return the size of a value in bytes.
A structured debug information entry.
static DIE * get(BumpPtrAllocator &Alloc, dwarf::Tag Tag)
StringRef - Represent a constant reference to a string, i.e.
LLVM Value Representation.
void addChild(DIE *Child)
Adds a specified Child 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 > addLocListAttribute(dwarf::Attribute Attr, dwarf::Form AttrForm, uint64_t Value)
Adds specified location list attribute to the current DIE.
BumpPtrAllocator & Allocator
std::pair< DIEValue &, size_t > addStringPlaceholderAttribute(dwarf::Attribute Attr, dwarf::Form AttrForm)
Adds string attribute with dummy offset to the current DIE.
DIEGenerator(DIE *OutputDIE, BumpPtrAllocator &Allocator, DwarfUnit &CU)
DIE * createDIE(dwarf::Tag DieTag, uint32_t OutOffset)
Creates a DIE of specified tag DieTag and OutOffset.
DIEGenerator(BumpPtrAllocator &Allocator, DwarfUnit &CU)
std::pair< DIEValue &, size_t > addAttribute(dwarf::Attribute Attr, dwarf::Form AttrForm, T &&Value)
std::pair< DIEValue &, size_t > addIndexedStringAttribute(dwarf::Attribute Attr, dwarf::Form AttrForm, uint64_t Idx)
Adds indexed string attribute.
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 > 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.
std::pair< DIEValue &, size_t > addScalarAttribute(dwarf::Attribute Attr, dwarf::Form AttrForm, uint64_t Value)
Adds specified scalar attribute to the current DIE.
Base class for all Dwarf units(Compile unit/Type table unit).
SmallVector< uint64_t * > OffsetsPtrVector
Type for list of pointers to patches offsets.
This is an optimization pass for GlobalISel generic memory operations.
BumpPtrAllocatorImpl BumpPtrAllocator
The standard BumpPtrAllocator which just uses the default template parameters.
LLVM_ABI unsigned getULEB128Size(uint64_t Value)
Utility function to get the size of the ULEB128-encoded value.