]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/llvm/include/llvm/DebugInfo/DWARF/DWARFAcceleratorTable.h
MFV r319945,r319946: 8264 want support for promoting datasets in libzfs_core
[FreeBSD/FreeBSD.git] / contrib / llvm / include / llvm / DebugInfo / DWARF / DWARFAcceleratorTable.h
1 //===--- DWARFAcceleratorTable.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_DWARFACCELERATORTABLE_H
11 #define LLVM_LIB_DEBUGINFO_DWARFACCELERATORTABLE_H
12
13 #include "llvm/ADT/SmallVector.h"
14 #include "llvm/DebugInfo/DWARF/DWARFFormValue.h"
15 #include "llvm/DebugInfo/DWARF/DWARFRelocMap.h"
16 #include "llvm/Support/Dwarf.h"
17 #include <cstdint>
18
19 namespace llvm {
20
21 class DWARFAcceleratorTable {
22
23   struct Header {
24     uint32_t Magic;
25     uint16_t Version;
26     uint16_t HashFunction;
27     uint32_t NumBuckets;
28     uint32_t NumHashes;
29     uint32_t HeaderDataLength;
30   };
31
32   struct HeaderData {
33     typedef uint16_t AtomType;
34     typedef dwarf::Form Form;
35     uint32_t DIEOffsetBase;
36     SmallVector<std::pair<AtomType, Form>, 3> Atoms;
37   };
38
39   struct Header Hdr;
40   struct HeaderData HdrData;
41   DataExtractor AccelSection;
42   DataExtractor StringSection;
43   const RelocAddrMap& Relocs;
44 public:
45   DWARFAcceleratorTable(DataExtractor AccelSection, DataExtractor StringSection,
46                         const RelocAddrMap &Relocs)
47     : AccelSection(AccelSection), StringSection(StringSection), Relocs(Relocs) {}
48
49   bool extract();
50   void dump(raw_ostream &OS) const;
51 };
52
53 }
54
55 #endif