LLVM  8.0.1
DWARFDebugInfoEntry.h
Go to the documentation of this file.
1 //===- DWARFDebugInfoEntry.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_DWARFDEBUGINFOENTRY_H
11 #define LLVM_DEBUGINFO_DWARFDEBUGINFOENTRY_H
12 
16 #include <cstdint>
17 
18 namespace llvm {
19 
20 class DataExtractor;
21 class DWARFUnit;
22 
23 /// DWARFDebugInfoEntry - A DIE with only the minimum required data.
25  /// Offset within the .debug_info of the start of this entry.
26  uint32_t Offset = 0;
27 
28  /// The integer depth of this DIE within the compile unit DIEs where the
29  /// compile/type unit DIE has a depth of zero.
30  uint32_t Depth = 0;
31 
32  const DWARFAbbreviationDeclaration *AbbrevDecl = nullptr;
33 
34 public:
35  DWARFDebugInfoEntry() = default;
36 
37  /// Extracts a debug info entry, which is a child of a given unit,
38  /// starting at a given offset. If DIE can't be extracted, returns false and
39  /// doesn't change OffsetPtr.
40  bool extractFast(const DWARFUnit &U, uint32_t *OffsetPtr);
41 
42  /// High performance extraction should use this call.
43  bool extractFast(const DWARFUnit &U, uint32_t *OffsetPtr,
44  const DWARFDataExtractor &DebugInfoData, uint32_t UEndOffset,
45  uint32_t Depth);
46 
47  uint32_t getOffset() const { return Offset; }
48  uint32_t getDepth() const { return Depth; }
49 
50  dwarf::Tag getTag() const {
51  return AbbrevDecl ? AbbrevDecl->getTag() : dwarf::DW_TAG_null;
52  }
53 
54  bool hasChildren() const { return AbbrevDecl && AbbrevDecl->hasChildren(); }
55 
57  return AbbrevDecl;
58  }
59 };
60 
61 } // end namespace llvm
62 
63 #endif // LLVM_DEBUGINFO_DWARFDEBUGINFOENTRY_H
This class represents lattice values for constants.
Definition: AllocatorList.h:24
bool extractFast(const DWARFUnit &U, uint32_t *OffsetPtr)
Extracts a debug info entry, which is a child of a given unit, starting at a given offset...
A DataExtractor (typically for an in-memory copy of an object-file section) plus a relocation map for...
const DWARFAbbreviationDeclaration * getAbbreviationDeclarationPtr() const
This file contains constants used for implementing Dwarf debug support.
DWARFDebugInfoEntry - A DIE with only the minimum required data.