ModuleDebugStream.h revision 319250
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/DebugSubsectionRecord.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::DebugSubsectionArray::Iterator LinesAndChecksumsIterator;
29
30public:
31  ModuleDebugStreamRef(const DbiModuleDescriptor &Module,
32                       std::unique_ptr<msf::MappedBlockStream> Stream);
33  ~ModuleDebugStreamRef();
34
35  Error reload();
36
37  uint32_t signature() const { return Signature; }
38
39  iterator_range<codeview::CVSymbolArray::Iterator>
40  symbols(bool *HadError) const;
41
42  llvm::iterator_range<LinesAndChecksumsIterator> linesAndChecksums() const;
43
44  bool hasLineInfo() const;
45
46  Error commit();
47
48private:
49  const DbiModuleDescriptor &Mod;
50
51  uint32_t Signature;
52
53  std::unique_ptr<msf::MappedBlockStream> Stream;
54
55  codeview::CVSymbolArray SymbolsSubstream;
56  BinaryStreamRef C11LinesSubstream;
57  BinaryStreamRef C13LinesSubstream;
58  BinaryStreamRef GlobalRefsSubstream;
59
60  codeview::DebugSubsectionArray LinesAndChecksums;
61};
62}
63}
64
65#endif
66