blob: bb25917b47dae63d208b68442ed2e1791b4e2764 [file] [log] [blame]
Frederic Risse837ec22014-11-14 16:15:53 +00001
2#include "llvm/ADT/SmallVector.h"
3#include "llvm/DebugInfo/DWARFFormValue.h"
4
5#include <cstdint>
6
7namespace llvm {
8
9class DWARFAcceleratorTable {
10
11 struct Header {
12 uint32_t Magic;
13 uint16_t Version;
14 uint16_t HashFunction;
15 uint32_t NumBuckets;
16 uint32_t NumHashes;
17 uint32_t HeaderDataLength;
18 };
19
20 struct HeaderData {
21 typedef uint16_t AtomType;
22 uint32_t DIEOffsetBase;
23 SmallVector<std::pair<AtomType, DWARFFormValue>, 1> Atoms;
24 };
25
26 struct Header Hdr;
27 struct HeaderData HdrData;
28 DataExtractor AccelSection;
29 DataExtractor StringSection;
30public:
31 DWARFAcceleratorTable(DataExtractor AccelSection, DataExtractor StringSection)
32 : AccelSection(AccelSection), StringSection(StringSection) {}
33
34 bool extract();
35 void dump(raw_ostream &OS);
36};
37
38}