InfoStream.h 2.0 KB

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