1 //===- DWARFAcceleratorTable.h ----------------------------------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 #ifndef LLVM_DEBUGINFO_DWARFACCELERATORTABLE_H
11 #define LLVM_DEBUGINFO_DWARFACCELERATORTABLE_H
13 #include "llvm/ADT/SmallVector.h"
14 #include "llvm/BinaryFormat/Dwarf.h"
15 #include "llvm/DebugInfo/DWARF/DWARFDataExtractor.h"
16 #include "llvm/DebugInfo/DWARF/DWARFRelocMap.h"
24 class DWARFAcceleratorTable {
28 uint16_t HashFunction;
31 uint32_t HeaderDataLength;
35 using AtomType = uint16_t;
36 using Form = dwarf::Form;
38 uint32_t DIEOffsetBase;
39 SmallVector<std::pair<AtomType, Form>, 3> Atoms;
43 struct HeaderData HdrData;
44 DWARFDataExtractor AccelSection;
45 DataExtractor StringSection;
48 DWARFAcceleratorTable(const DWARFDataExtractor &AccelSection,
49 DataExtractor StringSection)
50 : AccelSection(AccelSection), StringSection(StringSection) {}
53 uint32_t getNumBuckets();
54 uint32_t getNumHashes();
55 uint32_t getSizeHdr();
56 uint32_t getHeaderDataLength();
57 ArrayRef<std::pair<HeaderData::AtomType, HeaderData::Form>> getAtomsDesc();
60 /// Return information related to the DWARF DIE we're looking for when
61 /// performing a lookup by name.
63 /// \param HashDataOffset an offset into the hash data table
64 /// \returns DIEOffset the offset into the .debug_info section for the DIE
65 /// related to the input hash data offset. Currently this function returns
66 /// only the DIEOffset but it can be modified to return more data regarding
68 uint32_t readAtoms(uint32_t &HashDataOffset);
69 void dump(raw_ostream &OS) const;
72 } // end namespace llvm
74 #endif // LLVM_DEBUGINFO_DWARFACCELERATORTABLE_H