• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 //===- SymbolStream.cpp - PDB Symbol Stream Access --------------*- C++ -*-===//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 
10 #ifndef LLVM_DEBUGINFO_PDB_RAW_PDBSYMBOLSTREAM_H
11 #define LLVM_DEBUGINFO_PDB_RAW_PDBSYMBOLSTREAM_H
12 
13 #include "llvm/DebugInfo/CodeView/SymbolRecord.h"
14 
15 #include "llvm/Support/Error.h"
16 
17 namespace llvm {
18 namespace msf {
19 class MappedBlockStream;
20 }
21 namespace pdb {
22 class PDBFile;
23 
24 class SymbolStream {
25 public:
26   SymbolStream(std::unique_ptr<msf::MappedBlockStream> Stream);
27   ~SymbolStream();
28   Error reload();
29 
getSymbolArray()30   const codeview::CVSymbolArray &getSymbolArray() const {
31     return SymbolRecords;
32   }
33 
34   codeview::CVSymbol readRecord(uint32_t Offset) const;
35 
36   iterator_range<codeview::CVSymbolArray::Iterator>
37   getSymbols(bool *HadError) const;
38 
39   Error commit();
40 
41 private:
42   codeview::CVSymbolArray SymbolRecords;
43   std::unique_ptr<msf::MappedBlockStream> Stream;
44 };
45 }
46 }
47 
48 #endif
49