1 //===- InjectedSourceStream.h - PDB Headerblock Stream Access ---*- C++ -*-===// 2 // 3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4 // See https://llvm.org/LICENSE.txt for license information. 5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6 // 7 //===----------------------------------------------------------------------===// 8 9 #ifndef LLVM_DEBUGINFO_PDB_NATIVE_INJECTEDSOURCESTREAM_H 10 #define LLVM_DEBUGINFO_PDB_NATIVE_INJECTEDSOURCESTREAM_H 11 12 #include "llvm/DebugInfo/PDB/Native/HashTable.h" 13 #include "llvm/DebugInfo/PDB/Native/RawTypes.h" 14 #include "llvm/Support/Error.h" 15 16 namespace llvm { 17 namespace msf { 18 class MappedBlockStream; 19 } 20 namespace pdb { 21 class PDBStringTable; 22 23 class InjectedSourceStream { 24 public: 25 InjectedSourceStream(std::unique_ptr<msf::MappedBlockStream> Stream); 26 Error reload(const PDBStringTable &Strings); 27 28 using const_iterator = HashTable<SrcHeaderBlockEntry>::const_iterator; begin()29 const_iterator begin() const { return InjectedSourceTable.begin(); } end()30 const_iterator end() const { return InjectedSourceTable.end(); } 31 size()32 uint32_t size() const { return InjectedSourceTable.size(); } 33 34 private: 35 std::unique_ptr<msf::MappedBlockStream> Stream; 36 37 const SrcHeaderBlockHeader* Header; 38 HashTable<SrcHeaderBlockEntry> InjectedSourceTable; 39 }; 40 } 41 } 42 43 #endif 44