19 void DWARFAbbreviationDeclarationSet::clear() {
26 uint32_t *OffsetPtr) {
28 const uint32_t BeginOffset = *OffsetPtr;
31 uint32_t PrevAbbrCode = 0;
32 while (AbbrDecl.
extract(Data, OffsetPtr)) {
33 if (FirstAbbrCode == 0) {
34 FirstAbbrCode = AbbrDecl.
getCode();
36 if (PrevAbbrCode + 1 != AbbrDecl.
getCode()) {
38 FirstAbbrCode = UINT32_MAX;
41 PrevAbbrCode = AbbrDecl.
getCode();
42 Decls.push_back(std::move(AbbrDecl));
44 return BeginOffset != *OffsetPtr;
48 for (
const auto &Decl : Decls)
54 uint32_t AbbrCode)
const {
55 if (FirstAbbrCode == UINT32_MAX) {
56 for (
const auto &Decl : Decls) {
57 if (Decl.getCode() == AbbrCode)
62 if (AbbrCode < FirstAbbrCode || AbbrCode >= FirstAbbrCode + Decls.size())
64 return &Decls[AbbrCode - FirstAbbrCode];
71 void DWARFDebugAbbrev::clear() {
73 PrevAbbrOffsetPos = AbbrDeclSets.end();
82 uint32_t CUAbbrOffset = Offset;
83 if (!AbbrDecls.
extract(Data, &Offset))
85 AbbrDeclSets[CUAbbrOffset] = std::move(AbbrDecls);
90 if (AbbrDeclSets.empty()) {
95 for (
const auto &
I : AbbrDeclSets) {
96 OS <<
format(
"Abbrev table for offset: 0x%8.8" PRIx64
"\n",
I.first);
103 const auto End = AbbrDeclSets.end();
104 if (PrevAbbrOffsetPos != End && PrevAbbrOffsetPos->first == CUAbbrOffset) {
105 return &(PrevAbbrOffsetPos->second);
108 const auto Pos = AbbrDeclSets.find(CUAbbrOffset);
110 PrevAbbrOffsetPos = Pos;
111 return &(Pos->second);
DWARFAbbreviationDeclarationSet()
bool extract(DataExtractor Data, uint32_t *OffsetPtr)
void extract(DataExtractor Data)
bool extract(DataExtractor Data, uint32_t *OffsetPtr)
format_object< Ts...> format(const char *Fmt, const Ts &...Vals)
These are helper functions used to produce formatted output.
const DWARFAbbreviationDeclarationSet * getAbbreviationDeclarationSet(uint64_t CUAbbrOffset) const
void dump(raw_ostream &OS) const
const DWARFAbbreviationDeclaration * getAbbreviationDeclaration(uint32_t AbbrCode) const
void dump(raw_ostream &OS) const
This class implements an extremely fast bulk output stream that can only output to a stream...