ModuleDebugStream.h revision 317778
1//===- ModuleDebugStream.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_MODULEDEBUGSTREAM_H
11#define LLVM_DEBUGINFO_PDB_RAW_MODULEDEBUGSTREAM_H
12
13#include "llvm/ADT/iterator_range.h"
14#include "llvm/DebugInfo/CodeView/CVRecord.h"
15#include "llvm/DebugInfo/CodeView/ModuleDebugFragmentRecord.h"
16#include "llvm/DebugInfo/CodeView/SymbolRecord.h"
17#include "llvm/DebugInfo/MSF/MappedBlockStream.h"
18#include "llvm/Support/BinaryStreamArray.h"
19#include "llvm/Support/BinaryStreamRef.h"
20#include "llvm/Support/Error.h"
21
22namespace llvm {
23namespace pdb {
24class PDBFile;
25class DbiModuleDescriptor;
26
27class ModuleDebugStreamRef {
28  typedef codeview::ModuleDebugFragmentArray::Iterator
29      LinesAndChecksumsIterator;
30
31public:
32  ModuleDebugStreamRef(const DbiModuleDescriptor &Module,
33                       std::unique_ptr<msf::MappedBlockStream> Stream);
34  ~ModuleDebugStreamRef();
35
36  Error reload();
37
38  uint32_t signature() const { return Signature; }
39
40  iterator_range<codeview::CVSymbolArray::Iterator>
41  symbols(bool *HadError) const;
42
43  llvm::iterator_range<LinesAndChecksumsIterator> linesAndChecksums() const;
44
45  bool hasLineInfo() const;
46
47  Error commit();
48
49private:
50  const DbiModuleDescriptor &Mod;
51
52  uint32_t Signature;
53
54  std::unique_ptr<msf::MappedBlockStream> Stream;
55
56  codeview::CVSymbolArray SymbolsSubstream;
57  BinaryStreamRef C11LinesSubstream;
58  BinaryStreamRef C13LinesSubstream;
59  BinaryStreamRef GlobalRefsSubstream;
60
61  codeview::ModuleDebugFragmentArray LinesAndChecksums;
62};
63}
64}
65
66#endif
67