LLVM  14.0.0git
InfoStream.h
Go to the documentation of this file.
1 //===- InfoStream.h - PDB Info Stream (Stream 1) Access ---------*- C++ -*-===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 
9 #ifndef LLVM_DEBUGINFO_PDB_NATIVE_INFOSTREAM_H
10 #define LLVM_DEBUGINFO_PDB_NATIVE_INFOSTREAM_H
11 
12 #include "llvm/ADT/BitmaskEnum.h"
13 #include "llvm/ADT/StringMap.h"
19 
20 #include "llvm/Support/Endian.h"
21 #include "llvm/Support/Error.h"
22 
23 namespace llvm {
24 namespace pdb {
25 class InfoStreamBuilder;
26 class PDBFile;
27 
28 class InfoStream {
29  friend class InfoStreamBuilder;
30 
31 public:
32  InfoStream(std::unique_ptr<BinaryStream> Stream);
33 
34  Error reload();
35 
36  uint32_t getStreamSize() const;
37 
38  const InfoStreamHeader *getHeader() const { return Header; }
39 
40  bool containsIdStream() const;
41  PdbRaw_ImplVer getVersion() const;
42  uint32_t getSignature() const;
43  uint32_t getAge() const;
44  codeview::GUID getGuid() const;
46 
49 
50  const NamedStreamMap &getNamedStreams() const;
51 
53 
56 
57 private:
58  std::unique_ptr<BinaryStream> Stream;
59 
60  const InfoStreamHeader *Header;
61 
62  BinarySubstreamRef SubNamedStreams;
63 
64  std::vector<PdbRaw_FeatureSig> FeatureSignatures;
66 
67  uint32_t NamedStreamMapByteSize = 0;
68 
69  NamedStreamMap NamedStreams;
70 };
71 }
72 }
73 
74 #endif
RawConstants.h
llvm
This file implements support for optimizing divisions by a constant.
Definition: AllocatorList.h:23
GUID.h
NamedStreamMap.h
llvm::pdb::InfoStream::InfoStream
InfoStream(std::unique_ptr< BinaryStream > Stream)
Definition: InfoStream.cpp:22
llvm::codeview::GUID
This represents the 'GUID' type from windows.h.
Definition: GUID.h:21
Error.h
llvm::Expected
Tagged union holding either a T or a Error.
Definition: APFloat.h:42
llvm::pdb::InfoStream::getAge
uint32_t getAge() const
Definition: InfoStream.cpp:111
llvm::pdb::PdbFeatureNone
@ PdbFeatureNone
Definition: RawConstants.h:44
llvm::pdb::InfoStream::getNamedStreamMapByteSize
uint32_t getNamedStreamMapByteSize() const
Definition: InfoStream.cpp:115
llvm::pdb::PdbRaw_Features
PdbRaw_Features
Definition: RawConstants.h:43
llvm::pdb::InfoStream::getVersion
PdbRaw_ImplVer getVersion() const
Definition: InfoStream.cpp:103
llvm::pdb::InfoStream::getFeatureSignatures
ArrayRef< PdbRaw_FeatureSig > getFeatureSignatures() const
Definition: InfoStream.cpp:121
llvm::BinarySubstreamRef
Definition: BinaryStreamRef.h:200
llvm::pdb::InfoStream::reload
Error reload()
Definition: InfoStream.cpp:25
llvm::pdb::InfoStreamHeader
The header preceding the global PDB Stream (Stream 1)
Definition: RawTypes.h:304
llvm::pdb::InfoStream::named_streams
StringMap< uint32_t > named_streams() const
Definition: InfoStream.cpp:95
llvm::pdb::InfoStreamBuilder
Definition: InfoStreamBuilder.h:30
llvm::pdb::InfoStream::getSignature
uint32_t getSignature() const
Definition: InfoStream.cpp:107
StringMap.h
PDBTypes.h
llvm::StringMap< uint32_t >
llvm::pdb::InfoStream::getNamedStreams
const NamedStreamMap & getNamedStreams() const
Definition: InfoStream.cpp:125
llvm::pdb::InfoStream::getGuid
codeview::GUID getGuid() const
Definition: InfoStream.cpp:113
llvm::pdb::InfoStream::getFeatures
PdbRaw_Features getFeatures() const
Definition: InfoStream.cpp:119
MappedBlockStream.h
llvm::pdb::NamedStreamMap
Definition: NamedStreamMap.h:37
llvm::pdb::InfoStream::getStreamSize
uint32_t getStreamSize() const
Definition: InfoStream.cpp:86
llvm::pdb::InfoStream
Definition: InfoStream.h:28
llvm::ArrayRef
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
Definition: APInt.h:32
llvm::pdb::InfoStream::containsIdStream
bool containsIdStream() const
Definition: InfoStream.cpp:99
llvm::pdb::InfoStream::getNamedStreamsBuffer
BinarySubstreamRef getNamedStreamsBuffer() const
Definition: InfoStream.cpp:129
llvm::StringRef
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:58
llvm::pdb::InfoStream::getHeader
const InfoStreamHeader * getHeader() const
Definition: InfoStream.h:38
BitmaskEnum.h
uint32_t
llvm::pdb::PdbRaw_ImplVer
PdbRaw_ImplVer
Definition: RawConstants.h:21
llvm::GraphProgram::Name
Name
Definition: GraphWriter.h:52
llvm::Error
Lightweight error class with error context and mandatory checking.
Definition: Error.h:157
llvm::pdb::InfoStream::getNamedStreamIndex
Expected< uint32_t > getNamedStreamIndex(llvm::StringRef Name) const
Definition: InfoStream.cpp:88
Endian.h