LLVM  4.0.0
InfoStream.h
Go to the documentation of this file.
1 //===- InfoStream.h - PDB Info Stream (Stream 1) 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_PDBINFOSTREAM_H
11 #define LLVM_DEBUGINFO_PDB_RAW_PDBINFOSTREAM_H
12 
13 #include "llvm/ADT/StringMap.h"
18 
19 #include "llvm/Support/Endian.h"
20 #include "llvm/Support/Error.h"
21 
22 namespace llvm {
23 namespace pdb {
24 class InfoStreamBuilder;
25 class PDBFile;
26 
27 class InfoStream {
28  friend class InfoStreamBuilder;
29 
30 public:
31  InfoStream(std::unique_ptr<msf::MappedBlockStream> Stream);
32 
33  Error reload();
34 
35  PdbRaw_ImplVer getVersion() const;
36  uint32_t getSignature() const;
37  uint32_t getAge() const;
38  PDB_UniqueId getGuid() const;
39 
42 
43 private:
44  std::unique_ptr<msf::MappedBlockStream> Stream;
45 
46  // PDB file format version. We only support VC70. See the enumeration
47  // `PdbRaw_ImplVer` for the other possible values.
49 
50  // A 32-bit signature unique across all PDBs. This is generated with
51  // a call to time() when the PDB is written, but obviously this is not
52  // universally unique.
53  uint32_t Signature;
54 
55  // The number of times the PDB has been written. Might also be used to
56  // ensure that the PDB matches the executable.
57  uint32_t Age;
58 
59  // Due to the aforementioned limitations with `Signature`, this is a new
60  // signature present on VC70 and higher PDBs which is guaranteed to be
61  // universally unique.
62  PDB_UniqueId Guid;
63 
64  NameMap NamedStreams;
65 };
66 }
67 }
68 
69 #endif
uint32_t getAge() const
Definition: InfoStream.cpp:75
uint32_t getSignature() const
Definition: InfoStream.cpp:73
iterator_range< StringMapConstIterator< uint32_t > > named_streams() const
Definition: InfoStream.cpp:65
Defines a 128-bit unique identifier.
Definition: RawTypes.h:265
PDB_UniqueId getGuid() const
Definition: InfoStream.cpp:77
PdbRaw_ImplVer getVersion() const
Definition: InfoStream.cpp:69
A range adaptor for a pair of iterators.
Lightweight error class with error context and mandatory checking.
InfoStream(std::unique_ptr< msf::MappedBlockStream > Stream)
Definition: InfoStream.cpp:25
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:47
uint32_t getNamedStreamIndex(llvm::StringRef Name) const
Definition: InfoStream.cpp:57
const uint64_t Version
Definition: InstrProf.h:799