23void DWARFDebugAranges::extract(
33 if (
Error E =
Set.extract(DebugArangesData, &
Offset, WarningHandler)) {
34 RecoverableErrorHandler(std::move(E));
38 for (
const auto &
Desc :
Set.descriptors()) {
41 appendRange(CUOffset, LowPC, HighPC);
43 ParsedCUOffsets.
insert(CUOffset);
63 if (ParsedCUOffsets.
insert(CUOffset).second) {
68 for (
const auto &R : *CURanges)
69 appendRange(CUOffset, R.LowPC, R.HighPC);
76void DWARFDebugAranges::clear() {
79 ParsedCUOffsets.
clear();
86 Endpoints.emplace_back(LowPC, CUOffset,
true);
87 Endpoints.emplace_back(HighPC, CUOffset,
false);
90void DWARFDebugAranges::construct() {
91 std::multiset<uint64_t> ValidCUs;
95 for (
const auto &E : Endpoints) {
96 if (PrevAddress < E.Address && !ValidCUs.empty()) {
100 if (!Aranges.empty() && Aranges.back().HighPC() == PrevAddress &&
101 ValidCUs.find(Aranges.back().CUOffset) != ValidCUs.end()) {
102 Aranges.back().setHighPC(E.Address);
104 Aranges.emplace_back(PrevAddress, E.Address, *ValidCUs.begin());
108 if (E.IsRangeStart) {
109 ValidCUs.insert(E.CUOffset);
111 auto CUPos = ValidCUs.find(E.CUOffset);
112 assert(CUPos != ValidCUs.end());
113 ValidCUs.erase(CUPos);
115 PrevAddress = E.Address;
121 Endpoints.shrink_to_fit();
125 RangeCollIterator It =
127 if (It != Aranges.end() && It->LowPC <=
Address)
ConstantRange Range(APInt(BitWidth, Low), APInt(BitWidth, High))
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
DWARFContext This data structure is the top level entity that deals with dwarf debug information pars...
function_ref< void(Error)> getRecoverableErrorHandler()
compile_unit_range compile_units()
Get compile units in this context.
function_ref< void(Error)> getWarningHandler()
bool isLittleEndian() const
const DWARFObject & getDWARFObj() const
void generate(DWARFContext *CTX)
uint64_t findAddress(uint64_t Address) const
virtual StringRef getArangesSection() const
Lightweight error class with error context and mandatory checking.
Tagged union holding either a T or a Error.
Error takeError()
Take ownership of the stored error.
std::pair< iterator, bool > insert(const ValueT &V)
An efficient, type-erasing, non-owning reference to a callable.
This is an optimization pass for GlobalISel generic memory operations.
auto partition_point(R &&Range, Predicate P)
Binary search for the first iterator in a range where a predicate is false.
void sort(IteratorTy Start, IteratorTy End)
Description of the encoding of one expression Op.