37 for (
auto &
I : Info) {
45 if (
DIE.
getTag() != dwarf::DW_TAG_variable &&
50 if (!(Value =
DIE.find(dwarf::DW_AT_location))) {
51 if ((Value =
DIE.find(dwarf::DW_AT_const_value)) &&
56 if (
auto Block = Value->getAsBlock()) {
58 (*Block)[0] == dwarf::DW_OP_addr)
65 NextUnitOffset = StartOffset;
67 NextUnitOffset += 11 ;
68 NextUnitOffset += NewUnit->getUnitDie().getSize();
70 return NextUnitOffset;
77 ForwardDIEReferences.emplace_back(Die, RefUnit, Ctxt, Attr);
81 for (
const auto &
Ref : ForwardDIEReferences) {
86 std::tie(RefDie, RefUnit, Ctxt, Attr) =
Ref;
95 Labels.
insert({LabelLowPc, PcOffset});
103 if (FuncHighPc != FuncLowPc)
104 Ranges.
insert(FuncLowPc, FuncHighPc, PcOffset);
105 this->LowPc = std::min(LowPc, FuncLowPc + PcOffset);
106 this->HighPc =
std::max(HighPc, FuncHighPc + PcOffset);
110 if (Die.
getTag() != dwarf::DW_TAG_compile_unit)
111 RangeAttributes.push_back(Attr);
113 UnitRangeAttribute = Attr;
117 LocationAttributes.emplace_back(Attr, PcOffset);
122 Namespaces.emplace_back(Name, Die);
127 bool SkipPubSection) {
128 ObjC.emplace_back(Name, Die, SkipPubSection);
133 bool SkipPubSection) {
134 Pubnames.emplace_back(Name, Die, SkipPubSection);
139 bool ObjcClassImplementation,
141 Pubtypes.emplace_back(Name, Die, QualifiedNameHash, ObjcClassImplementation);
A DeclContext is a named program scope that is used for ODR uniquing of types.
This class represents lattice values for constants.
uint32_t getCanonicalDIEOffset() const
amdgpu Simplify well known AMD library false FunctionCallee Value const Twine & Name
Stores all information relating to a compile unit, be it in its original instance in the object file ...
void markEverythingAsKept()
Mark every DIE in this unit as kept.
void addNamespaceAccelerator(const DIE *Die, DwarfStringPoolEntryRef Name)
Add a name accelerator entry for Die with Name.
void set(uint64_t New) const
std::pair< iterator, bool > insert(const std::pair< KeyT, ValueT > &KV)
uint32_t ParentIdx
The index of this DIE's parent.
The access may reference the value stored in memory.
uint8_t getAddressByteSize() const
void noteRangeAttribute(const DIE &Die, PatchLocation Attr)
Keep track of a DW_AT_range attribute that we will need to patch up later.
void setHasInterestingContent()
void addObjCAccelerator(const DIE *Die, DwarfStringPoolEntryRef Name, bool SkipPubnamesSection=false)
Add various accelerator entries for Die with Name which is stored in the string table at Offset...
void addNameAccelerator(const DIE *Die, DwarfStringPoolEntryRef Name, bool SkipPubnamesSection=false)
Add a name accelerator entry for Die with Name.
static bool inFunctionScope(CompileUnit &U, unsigned Idx)
Check if the DIE at Idx is in the scope of a function.
Utility class that carries the DWARF compile/type unit and the debug info entry in an object...
void addTypeAccelerator(const DIE *Die, DwarfStringPoolEntryRef Name, bool ObjcClassImplementation, uint32_t QualifiedNameHash)
Add a type accelerator entry for Die with Name which is stored in the string table at Offset...
A structured debug information entry.
uint64_t computeNextUnitOffset()
Compute the end offset for this unit.
uint64_t getStartOffset() const
void insert(KeyT a, KeyT b, ValT y)
insert - Add a mapping of [a;b] to y, coalesce with adjacent intervals.
DWARFDie getUnitDIE(bool ExtractUnitDIEOnly=true)
void noteLocationAttribute(PatchLocation Attr, int64_t PcOffset)
Keep track of a location attribute pointing to a location list in the debug_loc section.
DIEInfo & getInfo(unsigned Idx)
Align max(MaybeAlign Lhs, Align Rhs)
void addLabelLowPc(uint64_t LabelLowPc, int64_t PcOffset)
Add the low_pc of a label that is relocated by applying offset PCOffset.
void fixupForwardReferences()
Apply all fixups recorded by noteForwardReference().
void noteForwardReference(DIE *Die, const CompileUnit *RefUnit, DeclContext *Ctxt, PatchLocation Attr)
Keep track of a forward reference to DIE Die in RefUnit by Attr.
dwarf::Tag getTag() const
String pool entry reference.
DWARFDie getDIEAtIndex(unsigned Index)
Return the DIE object at the given index.
dwarf::Tag getTag() const
Optional< DWARFFormValue > find(dwarf::Attribute Attr) const
Extract the specified attribute from this DIE.
unsigned getOffset() const
Get the compile/type unit relative offset of this DIE.
Optional< uint64_t > toUnsigned(const Optional< DWARFFormValue > &V)
Take an optional DWARFFormValue and try to extract an unsigned constant.
void addFunctionRange(uint64_t LowPC, uint64_t HighPC, int64_t PCOffset)
Add a function range [LowPC, HighPC) that is relocated by applying offset PCOffset.
DWARFUnit & getOrigUnit() const