LLVM  5.0.0
DWARFDebugAbbrev.h
Go to the documentation of this file.
1 //===- DWARFDebugAbbrev.h ---------------------------------------*- C++ -*-===//
2 //
3 // The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 
10 #ifndef LLVM_DEBUGINFO_DWARFDEBUGABBREV_H
11 #define LLVM_DEBUGINFO_DWARFDEBUGABBREV_H
12 
15 #include <cstdint>
16 #include <map>
17 #include <vector>
18 
19 namespace llvm {
20 
21 class raw_ostream;
22 
24  uint32_t Offset;
25  /// Code of the first abbreviation, if all abbreviations in the set have
26  /// consecutive codes. UINT32_MAX otherwise.
27  uint32_t FirstAbbrCode;
28  std::vector<DWARFAbbreviationDeclaration> Decls;
29 
30  using const_iterator =
31  std::vector<DWARFAbbreviationDeclaration>::const_iterator;
32 
33 public:
35 
36  uint32_t getOffset() const { return Offset; }
37  void dump(raw_ostream &OS) const;
38  bool extract(DataExtractor Data, uint32_t *OffsetPtr);
39 
41  getAbbreviationDeclaration(uint32_t AbbrCode) const;
42 
43  const_iterator begin() const {
44  return Decls.begin();
45  }
46 
47  const_iterator end() const {
48  return Decls.end();
49  }
50 
51 private:
52  void clear();
53 };
54 
56  using DWARFAbbreviationDeclarationSetMap =
57  std::map<uint64_t, DWARFAbbreviationDeclarationSet>;
58 
59  DWARFAbbreviationDeclarationSetMap AbbrDeclSets;
60  mutable DWARFAbbreviationDeclarationSetMap::const_iterator PrevAbbrOffsetPos;
61 
62 public:
64 
66  getAbbreviationDeclarationSet(uint64_t CUAbbrOffset) const;
67 
68  void dump(raw_ostream &OS) const;
70 
71  DWARFAbbreviationDeclarationSetMap::const_iterator begin() const {
72  return AbbrDeclSets.begin();
73  }
74 
75  DWARFAbbreviationDeclarationSetMap::const_iterator end() const {
76  return AbbrDeclSets.end();
77  }
78 
79 private:
80  void clear();
81 };
82 
83 } // end namespace llvm
84 
85 #endif // LLVM_DEBUGINFO_DWARFDEBUGABBREV_H
DWARFAbbreviationDeclarationSetMap::const_iterator end() const
void extract(DataExtractor Data)
bool extract(DataExtractor Data, uint32_t *OffsetPtr)
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...
Definition: raw_ostream.h:44
DWARFAbbreviationDeclarationSetMap::const_iterator begin() const