LLVM  4.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_LIB_DEBUGINFO_DWARFDEBUGABBREV_H
11 #define LLVM_LIB_DEBUGINFO_DWARFDEBUGABBREV_H
12 
14 #include <map>
15 #include <vector>
16 
17 namespace llvm {
18 
20  uint32_t Offset;
21  /// Code of the first abbreviation, if all abbreviations in the set have
22  /// consecutive codes. UINT32_MAX otherwise.
23  uint32_t FirstAbbrCode;
24  std::vector<DWARFAbbreviationDeclaration> Decls;
25 
26  typedef std::vector<DWARFAbbreviationDeclaration>::const_iterator
27  const_iterator;
28 
29 public:
31 
32  uint32_t getOffset() const { return Offset; }
33  void dump(raw_ostream &OS) const;
34  bool extract(DataExtractor Data, uint32_t *OffsetPtr);
35 
37  getAbbreviationDeclaration(uint32_t AbbrCode) const;
38 
39  const_iterator begin() const {
40  return Decls.begin();
41  }
42 
43  const_iterator end() const {
44  return Decls.end();
45  }
46 
47 private:
48  void clear();
49 };
50 
52  typedef std::map<uint64_t, DWARFAbbreviationDeclarationSet>
53  DWARFAbbreviationDeclarationSetMap;
54 
55  DWARFAbbreviationDeclarationSetMap AbbrDeclSets;
56  mutable DWARFAbbreviationDeclarationSetMap::const_iterator PrevAbbrOffsetPos;
57 
58 public:
60 
62  getAbbreviationDeclarationSet(uint64_t CUAbbrOffset) const;
63 
64  void dump(raw_ostream &OS) const;
65  void extract(DataExtractor Data);
66 
67  DWARFAbbreviationDeclarationSetMap::const_iterator begin() const {
68  return AbbrDeclSets.begin();
69  }
70 
71  DWARFAbbreviationDeclarationSetMap::const_iterator end() const {
72  return AbbrDeclSets.end();
73  }
74 
75 private:
76  void clear();
77 };
78 
79 }
80 
81 #endif
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