LLVM 20.0.0git
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_DWARF_DWARFDEBUGABBREV_H
10#define LLVM_DEBUGINFO_DWARF_DWARFDEBUGABBREV_H
11
14#include <cstdint>
15#include <map>
16#include <vector>
17
18namespace llvm {
19
20class 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
32public:
34
35 uint64_t getOffset() const { return Offset; }
36 void dump(raw_ostream &OS) const;
38
41
42 const_iterator begin() const {
43 return Decls.begin();
44 }
45
46 const_iterator end() const {
47 return Decls.end();
48 }
49
50 std::string getCodeRange() const;
51
52 uint32_t getFirstAbbrCode() const { return FirstAbbrCode; }
53
54private:
55 void clear();
56};
57
59 using DWARFAbbreviationDeclarationSetMap =
60 std::map<uint64_t, DWARFAbbreviationDeclarationSet>;
61
62 mutable DWARFAbbreviationDeclarationSetMap AbbrDeclSets;
63 mutable DWARFAbbreviationDeclarationSetMap::const_iterator PrevAbbrOffsetPos;
64 mutable std::optional<DataExtractor> Data;
65
66public:
68
70 getAbbreviationDeclarationSet(uint64_t CUAbbrOffset) const;
71
72 void dump(raw_ostream &OS) const;
73 Error parse() const;
74
75 DWARFAbbreviationDeclarationSetMap::const_iterator begin() const {
76 assert(!Data && "Must call parse before iterating over DWARFDebugAbbrev");
77 return AbbrDeclSets.begin();
78 }
79
80 DWARFAbbreviationDeclarationSetMap::const_iterator end() const {
81 return AbbrDeclSets.end();
82 }
83};
84
85} // end namespace llvm
86
87#endif // LLVM_DEBUGINFO_DWARF_DWARFDEBUGABBREV_H
loop extract
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
raw_pwrite_stream & OS
void dump(raw_ostream &OS) const
const DWARFAbbreviationDeclaration * getAbbreviationDeclaration(uint32_t AbbrCode) const
Expected< const DWARFAbbreviationDeclarationSet * > getAbbreviationDeclarationSet(uint64_t CUAbbrOffset) const
DWARFAbbreviationDeclarationSetMap::const_iterator end() const
void dump(raw_ostream &OS) const
DWARFAbbreviationDeclarationSetMap::const_iterator begin() const
Lightweight error class with error context and mandatory checking.
Definition: Error.h:160
Tagged union holding either a T or a Error.
Definition: Error.h:481
This class implements an extremely fast bulk output stream that can only output to a stream.
Definition: raw_ostream.h:52
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:18