summaryrefslogtreecommitdiffstats
path: root/llvm/lib/DebugInfo/PDB
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/DebugInfo/PDB')
-rw-r--r--llvm/lib/DebugInfo/PDB/Native/InfoStream.cpp13
-rw-r--r--llvm/lib/DebugInfo/PDB/Native/NamedStreamMap.cpp2
2 files changed, 14 insertions, 1 deletions
diff --git a/llvm/lib/DebugInfo/PDB/Native/InfoStream.cpp b/llvm/lib/DebugInfo/PDB/Native/InfoStream.cpp
index f3f64847fcf..1ce0fe84206 100644
--- a/llvm/lib/DebugInfo/PDB/Native/InfoStream.cpp
+++ b/llvm/lib/DebugInfo/PDB/Native/InfoStream.cpp
@@ -51,9 +51,16 @@ Error InfoStream::reload() {
Age = H->Age;
Guid = H->Guid;
- return NamedStreams.load(Reader);
+ uint32_t Offset = Reader.getOffset();
+ if (auto EC = NamedStreams.load(Reader))
+ return EC;
+ uint32_t NewOffset = Reader.getOffset();
+ NamedStreamMapByteSize = NewOffset - Offset;
+ return Error::success();
}
+uint32_t InfoStream::getStreamSize() const { return Stream->getLength(); }
+
uint32_t InfoStream::getNamedStreamIndex(llvm::StringRef Name) const {
uint32_t Result;
if (!NamedStreams.get(Name, Result))
@@ -76,6 +83,10 @@ uint32_t InfoStream::getAge() const { return Age; }
PDB_UniqueId InfoStream::getGuid() const { return Guid; }
+uint32_t InfoStream::getNamedStreamMapByteSize() const {
+ return NamedStreamMapByteSize;
+}
+
const NamedStreamMap &InfoStream::getNamedStreams() const {
return NamedStreams;
}
diff --git a/llvm/lib/DebugInfo/PDB/Native/NamedStreamMap.cpp b/llvm/lib/DebugInfo/PDB/Native/NamedStreamMap.cpp
index ae453282b06..c7ba32b82bc 100644
--- a/llvm/lib/DebugInfo/PDB/Native/NamedStreamMap.cpp
+++ b/llvm/lib/DebugInfo/PDB/Native/NamedStreamMap.cpp
@@ -114,6 +114,8 @@ NamedStreamMap::entries() const {
Mapping.end());
}
+uint32_t NamedStreamMap::size() const { return Mapping.size(); }
+
bool NamedStreamMap::get(StringRef Stream, uint32_t &StreamNo) const {
auto Iter = Mapping.find(Stream);
if (Iter == Mapping.end())
OpenPOWER on IntegriCloud