PublicsStream.h 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. #pragma once
  2. #ifdef __GNUC__
  3. #pragma GCC diagnostic push
  4. #pragma GCC diagnostic ignored "-Wunused-parameter"
  5. #endif
  6. //===- PublicsStream.h - PDB Public Symbol Stream -------- ------*- C++ -*-===//
  7. //
  8. // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
  9. // See https://llvm.org/LICENSE.txt for license information.
  10. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  11. //
  12. //===----------------------------------------------------------------------===//
  13. #ifndef LLVM_DEBUGINFO_PDB_NATIVE_PUBLICSSTREAM_H
  14. #define LLVM_DEBUGINFO_PDB_NATIVE_PUBLICSSTREAM_H
  15. #include "llvm/DebugInfo/PDB/Native/GlobalsStream.h"
  16. #include "llvm/Support/BinaryStreamArray.h"
  17. #include "llvm/Support/Error.h"
  18. namespace llvm {
  19. namespace msf {
  20. class MappedBlockStream;
  21. }
  22. namespace pdb {
  23. struct PublicsStreamHeader;
  24. struct SectionOffset;
  25. class PublicsStream {
  26. public:
  27. PublicsStream(std::unique_ptr<msf::MappedBlockStream> Stream);
  28. ~PublicsStream();
  29. Error reload();
  30. uint32_t getSymHash() const;
  31. uint16_t getThunkTableSection() const;
  32. uint32_t getThunkTableOffset() const;
  33. const GSIHashTable &getPublicsTable() const { return PublicsTable; }
  34. FixedStreamArray<support::ulittle32_t> getAddressMap() const {
  35. return AddressMap;
  36. }
  37. FixedStreamArray<support::ulittle32_t> getThunkMap() const {
  38. return ThunkMap;
  39. }
  40. FixedStreamArray<SectionOffset> getSectionOffsets() const {
  41. return SectionOffsets;
  42. }
  43. private:
  44. std::unique_ptr<msf::MappedBlockStream> Stream;
  45. GSIHashTable PublicsTable;
  46. FixedStreamArray<support::ulittle32_t> AddressMap;
  47. FixedStreamArray<support::ulittle32_t> ThunkMap;
  48. FixedStreamArray<SectionOffset> SectionOffsets;
  49. const PublicsStreamHeader *Header;
  50. };
  51. }
  52. }
  53. #endif
  54. #ifdef __GNUC__
  55. #pragma GCC diagnostic pop
  56. #endif