Frederic Riss | e837ec2 | 2014-11-14 16:15:53 +0000 | [diff] [blame^] | 1 | |
| 2 | #include "llvm/ADT/SmallVector.h" |
| 3 | #include "llvm/DebugInfo/DWARFFormValue.h" |
| 4 | |
| 5 | #include <cstdint> |
| 6 | |
| 7 | namespace llvm { |
| 8 | |
| 9 | class 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; |
| 30 | public: |
| 31 | DWARFAcceleratorTable(DataExtractor AccelSection, DataExtractor StringSection) |
| 32 | : AccelSection(AccelSection), StringSection(StringSection) {} |
| 33 | |
| 34 | bool extract(); |
| 35 | void dump(raw_ostream &OS); |
| 36 | }; |
| 37 | |
| 38 | } |