LLVM: lib/DebugInfo/PDB/Native/InfoStream.cpp Source File (original) (raw)
1
2
3
4
5
6
7
8
14
15using namespace llvm;
17
19
21 : Stream(std::move(Stream)), Header(nullptr) {}
22
25
28 std::move(EC),
30 "PDB Stream does not contain a header."));
31
32 switch (Header->Version) {
37 break;
38 default:
40 "Unsupported PDB stream version.");
41 }
42
44 if (auto EC = NamedStreams.load(Reader))
45 return EC;
47 NamedStreamMapByteSize = NewOffset - Offset;
48
50 if (auto EC = Reader.readSubstream(SubNamedStreams, NamedStreamMapByteSize))
51 return EC;
52
53 bool Stop = false;
54 while (!Stop && !Reader.empty()) {
57 return EC;
58
59
60
61
64
65 Stop = true;
66 [[fallthrough]];
69 break;
72 break;
75 break;
76 default:
77 continue;
78 }
79 FeatureSignatures.push_back(Sig);
80 }
82}
83
85
88 if (!NamedStreams.get(Name, Result))
90 return Result;
91}
92
94 return NamedStreams.entries();
95}
96
100
104
106 return uint32_t(Header->Signature);
107}
108
110
112
114 return NamedStreamMapByteSize;
115}
116
118
120 return FeatureSignatures;
121}
122
124 return NamedStreams;
125}
126
128 return SubNamedStreams;
129}
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
Provides read only access to a subclass of BinaryStream.
Error readObject(const T *&Dest)
Get a pointer to an object of type T from the underlying stream, as if by memcpy, and store the resul...
LLVM_ABI Error readSubstream(BinarySubstreamRef &Ref, uint32_t Length)
Read Length bytes from the underlying stream into Ref.
Error readEnum(T &Dest)
Similar to readInteger.
uint64_t getOffset() const
void setOffset(uint64_t Off)
Lightweight error class with error context and mandatory checking.
static ErrorSuccess success()
Create a success value.
Tagged union holding either a T or a Error.
StringMap - This is an unconventional map that is specialized for handling keys that are "strings",...
StringRef - Represent a constant reference to a string, i.e.
LLVM_ABI codeview::GUID getGuid() const
Definition InfoStream.cpp:111
LLVM_ABI Expected< uint32_t > getNamedStreamIndex(llvm::StringRef Name) const
Definition InfoStream.cpp:86
LLVM_ABI ArrayRef< PdbRaw_FeatureSig > getFeatureSignatures() const
Definition InfoStream.cpp:119
LLVM_ABI Error reload()
Definition InfoStream.cpp:23
LLVM_ABI uint32_t getStreamSize() const
Definition InfoStream.cpp:84
LLVM_ABI const NamedStreamMap & getNamedStreams() const
Definition InfoStream.cpp:123
LLVM_ABI InfoStream(std::unique_ptr< BinaryStream > Stream)
Definition InfoStream.cpp:20
LLVM_ABI PdbRaw_Features getFeatures() const
Definition InfoStream.cpp:117
LLVM_ABI bool containsIdStream() const
Definition InfoStream.cpp:97
LLVM_ABI uint32_t getAge() const
Definition InfoStream.cpp:109
LLVM_ABI StringMap< uint32_t > named_streams() const
Definition InfoStream.cpp:93
LLVM_ABI uint32_t getNamedStreamMapByteSize() const
Definition InfoStream.cpp:113
LLVM_ABI PdbRaw_ImplVer getVersion() const
Definition InfoStream.cpp:101
LLVM_ABI uint32_t getSignature() const
Definition InfoStream.cpp:105
LLVM_ABI BinarySubstreamRef getNamedStreamsBuffer() const
Definition InfoStream.cpp:127
@ PdbFeatureMinimalDebugInfo
@ PdbFeatureNoTypeMerging
@ PdbFeatureContainsIdStream
This is an optimization pass for GlobalISel generic memory operations.
Error joinErrors(Error E1, Error E2)
Concatenate errors.
Error make_error(ArgTs &&... Args)
Make a Error instance representing failure using the given error info type.
OutputIt move(R &&Range, OutputIt Out)
Provide wrappers to std::move which take ranges instead of having to pass begin/end explicitly.
Implement std::hash so that hash_code can be used in STL containers.
This represents the 'GUID' type from windows.h.