InfoStream.h 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. #pragma once
  2. #ifdef __GNUC__
  3. #pragma GCC diagnostic push
  4. #pragma GCC diagnostic ignored "-Wunused-parameter"
  5. #endif
  6. //===- InfoStream.h - PDB Info Stream (Stream 1) Access ---------*- 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_INFOSTREAM_H
  14. #define LLVM_DEBUGINFO_PDB_NATIVE_INFOSTREAM_H
  15. #include "llvm/ADT/BitmaskEnum.h"
  16. #include "llvm/ADT/StringMap.h"
  17. #include "llvm/DebugInfo/CodeView/GUID.h"
  18. #include "llvm/DebugInfo/MSF/MappedBlockStream.h"
  19. #include "llvm/DebugInfo/PDB/Native/NamedStreamMap.h"
  20. #include "llvm/DebugInfo/PDB/Native/RawConstants.h"
  21. #include "llvm/DebugInfo/PDB/PDBTypes.h"
  22. #include "llvm/Support/Endian.h"
  23. #include "llvm/Support/Error.h"
  24. namespace llvm {
  25. namespace pdb {
  26. class InfoStreamBuilder;
  27. class PDBFile;
  28. class InfoStream {
  29. friend class InfoStreamBuilder;
  30. public:
  31. InfoStream(std::unique_ptr<BinaryStream> Stream);
  32. Error reload();
  33. uint32_t getStreamSize() const;
  34. const InfoStreamHeader *getHeader() const { return Header; }
  35. bool containsIdStream() const;
  36. PdbRaw_ImplVer getVersion() const;
  37. uint32_t getSignature() const;
  38. uint32_t getAge() const;
  39. codeview::GUID getGuid() const;
  40. uint32_t getNamedStreamMapByteSize() const;
  41. PdbRaw_Features getFeatures() const;
  42. ArrayRef<PdbRaw_FeatureSig> getFeatureSignatures() const;
  43. const NamedStreamMap &getNamedStreams() const;
  44. BinarySubstreamRef getNamedStreamsBuffer() const;
  45. Expected<uint32_t> getNamedStreamIndex(llvm::StringRef Name) const;
  46. StringMap<uint32_t> named_streams() const;
  47. private:
  48. std::unique_ptr<BinaryStream> Stream;
  49. const InfoStreamHeader *Header;
  50. BinarySubstreamRef SubNamedStreams;
  51. std::vector<PdbRaw_FeatureSig> FeatureSignatures;
  52. PdbRaw_Features Features = PdbFeatureNone;
  53. uint32_t NamedStreamMapByteSize = 0;
  54. NamedStreamMap NamedStreams;
  55. };
  56. }
  57. }
  58. #endif
  59. #ifdef __GNUC__
  60. #pragma GCC diagnostic pop
  61. #endif