InjectedSourceStream.h 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. #pragma once
  2. #ifdef __GNUC__
  3. #pragma GCC diagnostic push
  4. #pragma GCC diagnostic ignored "-Wunused-parameter"
  5. #endif
  6. //===- InjectedSourceStream.h - PDB Headerblock Stream 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_INJECTEDSOURCESTREAM_H
  14. #define LLVM_DEBUGINFO_PDB_NATIVE_INJECTEDSOURCESTREAM_H
  15. #include "llvm/DebugInfo/PDB/Native/HashTable.h"
  16. #include "llvm/DebugInfo/PDB/Native/RawTypes.h"
  17. #include "llvm/Support/Error.h"
  18. namespace llvm {
  19. namespace msf {
  20. class MappedBlockStream;
  21. }
  22. namespace pdb {
  23. class PDBStringTable;
  24. class InjectedSourceStream {
  25. public:
  26. InjectedSourceStream(std::unique_ptr<msf::MappedBlockStream> Stream);
  27. Error reload(const PDBStringTable &Strings);
  28. using const_iterator = HashTable<SrcHeaderBlockEntry>::const_iterator;
  29. const_iterator begin() const { return InjectedSourceTable.begin(); }
  30. const_iterator end() const { return InjectedSourceTable.end(); }
  31. uint32_t size() const { return InjectedSourceTable.size(); }
  32. private:
  33. std::unique_ptr<msf::MappedBlockStream> Stream;
  34. const SrcHeaderBlockHeader* Header;
  35. HashTable<SrcHeaderBlockEntry> InjectedSourceTable;
  36. };
  37. }
  38. }
  39. #endif
  40. #ifdef __GNUC__
  41. #pragma GCC diagnostic pop
  42. #endif