16 uint64_t InputStart, uint64_t InputEnd,
17 uint64_t OutputOffset,
19 if (!Source.Expression) {
21 int64_t(OutputOffset) - int64_t(InputStart)});
23 uint64_t ExpressionStart = InputEnd - Source.Expression->InputSize;
25 Source.Expression->Operations) {
26 uint64_t Start =
Op.InputStart;
28 Start += ExpressionStart;
30 {
Op.InputSection, Start, Start +
Op.Size,
31 int64_t(OutputOffset +
Op.OutputOffset) - int64_t(Start)});
38 bool IsLowPC = Attr == dwarf::DW_AT_low_pc;
39 if (Source.Entry && Attr != dwarf::DW_AT_high_pc &&
40 !(IsLowPC &&
Tag == dwarf::DW_TAG_compile_unit))
41 DebugAddrFixups.push_back({*Source.Entry, IsLowPC});
45 for (DebugInfoFixup &Fixup : DIEFixups) {
46 Fixup.LinkedOffset += AbbrevNumberSize;
47 DebugInfoFixups.push_back(Fixup);
54 for (
const DebugInfoFixup &Fixup : DebugInfoFixups)
57 Fixup.LinkedOffset, Fixup.InputStart, Fixup.InputEnd);
59 if (!DebugAddrTableOffset)
67 Sorted, [](
const DebugAddrFixup &LHS,
const DebugAddrFixup &RHS) {
68 return std::make_pair(LHS.Entry.OutputIndex, !LHS.IsLowPC) <
69 std::make_pair(RHS.Entry.OutputIndex, !RHS.IsLowPC);
72 std::optional<uint64_t> SavedIndex;
73 for (
const DebugAddrFixup &Fixup : Sorted) {
74 if (SavedIndex == Fixup.Entry.OutputIndex)
76 uint64_t InputOffset = Fixup.Entry.InputOffset;
77 uint64_t OutputOffset =
78 *DebugAddrTableOffset + Fixup.Entry.OutputIndex * AddrSize;
81 UnitOffset, int64_t(OutputOffset) - int64_t(InputOffset),
82 InputOffset, InputOffset + AddrSize))
83 SavedIndex = Fixup.Entry.OutputIndex;
89 DebugInfoFixups.clear();
90 DebugAddrFixups.clear();
91 DebugAddrTableOffset.reset();
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
AddressesMap represents information about valid addresses used by debug information.
virtual bool updateAndSaveValidRelocs(RelocSectionKind InSection, RelocSectionKind OutSection, uint64_t OriginalUnitOffset, int64_t LinkedOffset, uint64_t StartOffset, uint64_t EndOffset)=0
Save the valid relocations in [StartOffset, EndOffset) of InSection, moved by LinkedOffset into OutSe...
LLVM_ABI void noteAttribute(dwarf::Tag Tag, dwarf::Attribute Attr, uint64_t InputStart, uint64_t InputEnd, uint64_t OutputOffset, const AttributeSource &Source)
Notes that the attribute Attr of a DIE tagged Tag was cloned from [InputStart, InputEnd) of ....
LLVM_ABI void save(AddressesMap &Addresses, uint64_t UnitOffset, uint8_t AddrSize) const
Saves the relocations, for the unit at UnitOffset in the input.
LLVM_ABI void finishDIE(uint64_t AbbrevNumberSize)
Completes the attributes noted since the previous call, once the DIE has an abbreviation number.
This is an optimization pass for GlobalISel generic memory operations.
void stable_sort(R &&Range)
DWARFExpression::Operation Op
What an attribute being cloned was cloned from.