• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 //===- ModStream.h - PDB Module Info Stream Access ------------------------===//
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_MODSTREAM_H
11 #define LLVM_DEBUGINFO_PDB_RAW_MODSTREAM_H
12 
13 #include "llvm/ADT/iterator_range.h"
14 #include "llvm/DebugInfo/CodeView/CVRecord.h"
15 #include "llvm/DebugInfo/CodeView/ModuleSubstream.h"
16 #include "llvm/DebugInfo/CodeView/StreamArray.h"
17 #include "llvm/DebugInfo/CodeView/StreamRef.h"
18 #include "llvm/DebugInfo/CodeView/SymbolRecord.h"
19 #include "llvm/DebugInfo/PDB/Raw/MappedBlockStream.h"
20 #include "llvm/Support/Error.h"
21 
22 namespace llvm {
23 namespace pdb {
24 class PDBFile;
25 class ModInfo;
26 
27 class ModStream {
28 public:
29   ModStream(const ModInfo &Module, std::unique_ptr<MappedBlockStream> Stream);
30   ~ModStream();
31 
32   Error reload();
33 
34   iterator_range<codeview::CVSymbolArray::Iterator>
35   symbols(bool *HadError) const;
36 
37   iterator_range<codeview::ModuleSubstreamArray::Iterator>
38   lines(bool *HadError) const;
39 
40   Error commit();
41 
42 private:
43   const ModInfo &Mod;
44 
45   std::unique_ptr<MappedBlockStream> Stream;
46 
47   codeview::CVSymbolArray SymbolsSubstream;
48   codeview::StreamRef LinesSubstream;
49   codeview::StreamRef C13LinesSubstream;
50   codeview::StreamRef GlobalRefsSubstream;
51 
52   codeview::ModuleSubstreamArray LineInfo;
53 };
54 }
55 }
56 
57 #endif
58