DWARFAcceleratorTable.h 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  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. #ifndef LLVM_LIB_DEBUGINFO_DWARFACCELERATORTABLE_H
  10. #define LLVM_LIB_DEBUGINFO_DWARFACCELERATORTABLE_H
  11. #include "llvm/ADT/SmallVector.h"
  12. #include "llvm/DebugInfo/DWARF/DWARFFormValue.h"
  13. #include "llvm/DebugInfo/DWARF/DWARFRelocMap.h"
  14. #include <cstdint>
  15. namespace llvm {
  16. class DWARFAcceleratorTable {
  17. struct Header {
  18. uint32_t Magic;
  19. uint16_t Version;
  20. uint16_t HashFunction;
  21. uint32_t NumBuckets;
  22. uint32_t NumHashes;
  23. uint32_t HeaderDataLength;
  24. };
  25. struct HeaderData {
  26. typedef uint16_t AtomType;
  27. typedef uint16_t Form;
  28. uint32_t DIEOffsetBase;
  29. SmallVector<std::pair<AtomType, Form>, 3> Atoms;
  30. };
  31. struct Header Hdr;
  32. struct HeaderData HdrData;
  33. DataExtractor AccelSection;
  34. DataExtractor StringSection;
  35. const RelocAddrMap& Relocs;
  36. public:
  37. DWARFAcceleratorTable(DataExtractor AccelSection, DataExtractor StringSection,
  38. const RelocAddrMap &Relocs)
  39. : AccelSection(AccelSection), StringSection(StringSection), Relocs(Relocs) {}
  40. bool extract();
  41. void dump(raw_ostream &OS) const;
  42. };
  43. }
  44. #endif