22void DWARFDebugAranges::extract(
32 if (
Error E =
Set.extract(DebugArangesData, &
Offset, WarningHandler)) {
33 RecoverableErrorHandler(std::move(E));
37 for (
const auto &
Desc :
Set.descriptors()) {
40 appendRange(CUOffset, LowPC, HighPC);
42 ParsedCUOffsets.
insert(CUOffset);
62 if (ParsedCUOffsets.
insert(CUOffset).second) {
67 for (
const auto &R : *CURanges)
68 appendRange(CUOffset, R.LowPC, R.HighPC);
75void DWARFDebugAranges::clear() {
78 ParsedCUOffsets.
clear();
85 Endpoints.emplace_back(LowPC, CUOffset,
true);
86 Endpoints.emplace_back(HighPC, CUOffset,
false);
89void DWARFDebugAranges::construct() {
90 std::multiset<uint64_t> ValidCUs;
94 for (
const auto &E : Endpoints) {
95 if (PrevAddress < E.Address && !ValidCUs.empty()) {
99 if (!Aranges.empty() && Aranges.back().HighPC() == PrevAddress &&
100 ValidCUs.find(Aranges.back().CUOffset) != ValidCUs.end()) {
101 Aranges.back().setHighPC(E.Address);
103 Aranges.emplace_back(PrevAddress, E.Address, *ValidCUs.begin());
107 if (E.IsRangeStart) {
108 ValidCUs.insert(E.CUOffset);
110 auto CUPos = ValidCUs.find(E.CUOffset);
111 assert(CUPos != ValidCUs.end());
112 ValidCUs.erase(CUPos);
114 PrevAddress = E.Address;
120 Endpoints.shrink_to_fit();
124 RangeCollIterator It =
126 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.