LLVM  10.0.0svn
DWARFDebugAbbrev.h
Go to the documentation of this file.
1 //===- DWARFDebugAbbrev.h ---------------------------------------*- C++ -*-===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 
9 #ifndef LLVM_DEBUGINFO_DWARFDEBUGABBREV_H
10 #define LLVM_DEBUGINFO_DWARFDEBUGABBREV_H
11 
14 #include <cstdint>
15 #include <map>
16 #include <vector>
17 
18 namespace llvm {
19 
20 class raw_ostream;
21 
23  uint64_t Offset;
24  /// Code of the first abbreviation, if all abbreviations in the set have
25  /// consecutive codes. UINT32_MAX otherwise.
26  uint32_t FirstAbbrCode;
27  std::vector<DWARFAbbreviationDeclaration> Decls;
28 
29  using const_iterator =
30  std::vector<DWARFAbbreviationDeclaration>::const_iterator;
31 
32 public:
34 
35  uint64_t getOffset() const { return Offset; }
36  void dump(raw_ostream &OS) const;
37  bool extract(DataExtractor Data, uint64_t *OffsetPtr);
38 
40  getAbbreviationDeclaration(uint32_t AbbrCode) const;
41 
42  const_iterator begin() const {
43  return Decls.begin();
44  }
45 
46  const_iterator end() const {
47  return Decls.end();
48  }
49 
50 private:
51  void clear();
52 };
53 
55  using DWARFAbbreviationDeclarationSetMap =
56  std::map<uint64_t, DWARFAbbreviationDeclarationSet>;
57 
58  mutable DWARFAbbreviationDeclarationSetMap AbbrDeclSets;
59  mutable DWARFAbbreviationDeclarationSetMap::const_iterator PrevAbbrOffsetPos;
61 
62 public:
64 
66  getAbbreviationDeclarationSet(uint64_t CUAbbrOffset) const;
67 
68  void dump(raw_ostream &OS) const;
69  void parse() const;
70  void extract(DataExtractor Data);
71 
72  DWARFAbbreviationDeclarationSetMap::const_iterator begin() const {
73  parse();
74  return AbbrDeclSets.begin();
75  }
76 
77  DWARFAbbreviationDeclarationSetMap::const_iterator end() const {
78  return AbbrDeclSets.end();
79  }
80 
81 private:
82  void clear();
83 };
84 
85 } // end namespace llvm
86 
87 #endif // LLVM_DEBUGINFO_DWARFDEBUGABBREV_H
This class represents lattice values for constants.
Definition: AllocatorList.h:23
void dump(raw_ostream &OS) const
const DWARFAbbreviationDeclaration * getAbbreviationDeclaration(uint32_t AbbrCode) const
DWARFAbbreviationDeclarationSetMap::const_iterator begin() const
bool extract(DataExtractor Data, uint64_t *OffsetPtr)
DWARFAbbreviationDeclarationSetMap::const_iterator end() const
This class implements an extremely fast bulk output stream that can only output to a stream...
Definition: raw_ostream.h:45
static llvm::Error parse(DataExtractor &Data, uint64_t BaseAddr, LineEntryCallback const &Callback)
Definition: LineTable.cpp:54