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];
73 void DWARFDebugAbbrev::clear() {
75 PrevAbbrOffsetPos = AbbrDeclSets.end();
88 auto I = AbbrDeclSets.begin();
89 while (
Data->isValidOffset(Offset)) {
90 while (
I != AbbrDeclSets.end() &&
I->first < Offset)
95 AbbrDeclSets.insert(
I, std::make_pair(CUAbbrOffset, std::move(AbbrDecls)));
103 if (AbbrDeclSets.empty()) {
108 for (
const auto &
I : AbbrDeclSets) {
109 OS <<
format(
"Abbrev table for offset: 0x%8.8" PRIx64
"\n",
I.first);
116 const auto End = AbbrDeclSets.end();
117 if (PrevAbbrOffsetPos != End && PrevAbbrOffsetPos->first == CUAbbrOffset) {
118 return &(PrevAbbrOffsetPos->second);
121 const auto Pos = AbbrDeclSets.find(CUAbbrOffset);
123 PrevAbbrOffsetPos = Pos;
124 return &(Pos->second);
127 if (
Data && CUAbbrOffset < Data->getData().size()) {
133 AbbrDeclSets.insert(std::make_pair(CUAbbrOffset, std::move(AbbrDecls)))
135 return &PrevAbbrOffsetPos->second;
DWARFAbbreviationDeclarationSet()
bool extract(DataExtractor Data, uint32_t *OffsetPtr)
This class represents lattice values for constants.
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.
void dump(raw_ostream &OS) const
const DWARFAbbreviationDeclaration * getAbbreviationDeclaration(uint32_t AbbrCode) const
void dump(raw_ostream &OS) const
const DWARFAbbreviationDeclarationSet * getAbbreviationDeclarationSet(uint64_t CUAbbrOffset) const
llvm::Expected< Value > parse(llvm::StringRef JSON)
Parses the provided JSON source, or returns a ParseError.
This class implements an extremely fast bulk output stream that can only output to a stream...