LLVM  4.0.0
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_LIB_DEBUGINFO_DWARFDEBUGINFOENTRY_H
11 #define LLVM_LIB_DEBUGINFO_DWARFDEBUGINFOENTRY_H
12 
13 #include "llvm/ADT/SmallVector.h"
17 #include "llvm/Support/DataTypes.h"
18 #include "llvm/Support/Dwarf.h"
19 
20 namespace llvm {
21 
22 class DWARFDebugAranges;
23 class DWARFCompileUnit;
24 class DWARFUnit;
25 class DWARFContext;
26 class DWARFFormValue;
27 struct DWARFDebugInfoEntryInlinedChain;
28 
29 /// DWARFDebugInfoEntry - A DIE with only the minimum required data.
31  /// Offset within the .debug_info of the start of this entry.
32  uint32_t Offset;
33 
34  /// The integer depth of this DIE within the compile unit DIEs where the
35  /// compile/type unit DIE has a depth of zero.
36  uint32_t Depth;
37 
38  const DWARFAbbreviationDeclaration *AbbrevDecl;
39 public:
41  : Offset(0), Depth(0), AbbrevDecl(nullptr) {}
42 
43  /// Extracts a debug info entry, which is a child of a given unit,
44  /// starting at a given offset. If DIE can't be extracted, returns false and
45  /// doesn't change OffsetPtr.
46  bool extractFast(const DWARFUnit &U, uint32_t *OffsetPtr);
47  /// High performance extraction should use this call.
48  bool extractFast(const DWARFUnit &U, uint32_t *OffsetPtr,
49  const DataExtractor &DebugInfoData,
50  uint32_t UEndOffset,
51  uint32_t Depth);
52 
53  uint32_t getOffset() const { return Offset; }
54  uint32_t getDepth() const { return Depth; }
55  dwarf::Tag getTag() const {
56  return AbbrevDecl ? AbbrevDecl->getTag() : dwarf::DW_TAG_null;
57  }
58  bool hasChildren() const { return AbbrevDecl && AbbrevDecl->hasChildren(); }
60  return AbbrevDecl;
61  }
62 };
63 
64 }
65 
66 #endif
dwarf::Tag getTag() const
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...
const DWARFAbbreviationDeclaration * getAbbreviationDeclarationPtr() const
DWARFDebugInfoEntry - A DIE with only the minimum required data.