InjectedSourceStream.h 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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/MSF/MappedBlockStream.h"
  16. #include "llvm/DebugInfo/PDB/Native/HashTable.h"
  17. #include "llvm/Support/Error.h"
  18. namespace llvm {
  19. namespace pdb {
  20. struct SrcHeaderBlockEntry;
  21. struct SrcHeaderBlockHeader;
  22. class PDBStringTable;
  23. class InjectedSourceStream {
  24. public:
  25. InjectedSourceStream(std::unique_ptr<msf::MappedBlockStream> Stream);
  26. Error reload(const PDBStringTable &Strings);
  27. using const_iterator = HashTable<SrcHeaderBlockEntry>::const_iterator;
  28. const_iterator begin() const { return InjectedSourceTable.begin(); }
  29. const_iterator end() const { return InjectedSourceTable.end(); }
  30. uint32_t size() const { return InjectedSourceTable.size(); }
  31. private:
  32. std::unique_ptr<msf::MappedBlockStream> Stream;
  33. const SrcHeaderBlockHeader* Header;
  34. HashTable<SrcHeaderBlockEntry> InjectedSourceTable;
  35. };
  36. }
  37. } // namespace llvm
  38. #endif
  39. #ifdef __GNUC__
  40. #pragma GCC diagnostic pop
  41. #endif