23 void DWARFAbbreviationDeclarationSet::clear() {
32 const uint32_t BeginOffset = *OffsetPtr;
36 while (AbbrDecl.
extract(Data, OffsetPtr)) {
37 if (FirstAbbrCode == 0) {
38 FirstAbbrCode = AbbrDecl.
getCode();
40 if (PrevAbbrCode + 1 != AbbrDecl.
getCode()) {
42 FirstAbbrCode = UINT32_MAX;
45 PrevAbbrCode = AbbrDecl.
getCode();
46 Decls.push_back(std::move(AbbrDecl));
48 return BeginOffset != *OffsetPtr;
52 for (
const auto &Decl : Decls)
59 if (FirstAbbrCode == UINT32_MAX) {
60 for (
const auto &Decl : Decls) {
61 if (Decl.getCode() == AbbrCode)
66 if (AbbrCode < FirstAbbrCode || AbbrCode >= FirstAbbrCode + Decls.size())
68 return &Decls[AbbrCode - FirstAbbrCode];
75 void DWARFDebugAbbrev::clear() {
77 PrevAbbrOffsetPos = AbbrDeclSets.end();
87 if (!AbbrDecls.
extract(Data, &Offset))
89 AbbrDeclSets[CUAbbrOffset] = std::move(AbbrDecls);
94 if (AbbrDeclSets.empty()) {
99 for (
const auto &
I : AbbrDeclSets) {
100 OS <<
format(
"Abbrev table for offset: 0x%8.8" PRIx64
"\n",
I.first);
107 const auto End = AbbrDeclSets.end();
108 if (PrevAbbrOffsetPos !=
End && PrevAbbrOffsetPos->first == CUAbbrOffset) {
109 return &(PrevAbbrOffsetPos->second);
112 const auto Pos = AbbrDeclSets.find(CUAbbrOffset);
114 PrevAbbrOffsetPos = Pos;
115 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
static const unsigned End
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...