1 //===- InfoStream.h - PDB Info Stream (Stream 1) Access ---------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 #ifndef LLVM_DEBUGINFO_PDB_RAW_PDBINFOSTREAM_H
11 #define LLVM_DEBUGINFO_PDB_RAW_PDBINFOSTREAM_H
13 #include "llvm/ADT/StringMap.h"
14 #include "llvm/DebugInfo/PDB/PDBTypes.h"
15 #include "llvm/DebugInfo/PDB/Raw/MappedBlockStream.h"
16 #include "llvm/DebugInfo/PDB/Raw/NameMap.h"
17 #include "llvm/DebugInfo/PDB/Raw/RawConstants.h"
19 #include "llvm/Support/Endian.h"
20 #include "llvm/Support/Error.h"
24 class InfoStreamBuilder;
28 friend class InfoStreamBuilder;
31 support::ulittle32_t Version;
32 support::ulittle32_t Signature;
33 support::ulittle32_t Age;
38 InfoStream(std::unique_ptr<MappedBlockStream> Stream);
43 PdbRaw_ImplVer getVersion() const;
44 uint32_t getSignature() const;
45 uint32_t getAge() const;
46 PDB_UniqueId getGuid() const;
48 uint32_t getNamedStreamIndex(llvm::StringRef Name) const;
49 iterator_range<StringMapConstIterator<uint32_t>> named_streams() const;
52 std::unique_ptr<MappedBlockStream> Stream;
54 // PDB file format version. We only support VC70. See the enumeration
55 // `PdbRaw_ImplVer` for the other possible values.
58 // A 32-bit signature unique across all PDBs. This is generated with
59 // a call to time() when the PDB is written, but obviously this is not
60 // universally unique.
63 // The number of times the PDB has been written. Might also be used to
64 // ensure that the PDB matches the executable.
67 // Due to the aforementioned limitations with `Signature`, this is a new
68 // signature present on VC70 and higher PDBs which is guaranteed to be
69 // universally unique.