summaryrefslogtreecommitdiffstats
path: root/llvm/lib/DebugInfo/PDB/Raw/GlobalsStream.cpp
diff options
context:
space:
mode:
authorBob Haarman <llvm@inglorion.net>2016-10-21 19:43:19 +0000
committerBob Haarman <llvm@inglorion.net>2016-10-21 19:43:19 +0000
commit653baa2aaab66224c6f610dc133e8857cf53535a (patch)
tree09ce95ea21029889674451abf518c8207fc771c3 /llvm/lib/DebugInfo/PDB/Raw/GlobalsStream.cpp
parentda814cba0d4fb1d8afecc3cf6f215992bedc2f5b (diff)
downloadbcm5719-llvm-653baa2aaab66224c6f610dc133e8857cf53535a.tar.gz
bcm5719-llvm-653baa2aaab66224c6f610dc133e8857cf53535a.zip
[pdb] added support for dumping globals stream
Summary: This adds support for dumping the globals stream from PDB files using llvm-pdbdump, similar to the support we have for the publics stream. Reviewers: ruiu, zturner Subscribers: beanz, mgorny, modocache Differential Revision: https://reviews.llvm.org/D25801 llvm-svn: 284861
Diffstat (limited to 'llvm/lib/DebugInfo/PDB/Raw/GlobalsStream.cpp')
-rw-r--r--llvm/lib/DebugInfo/PDB/Raw/GlobalsStream.cpp46
1 files changed, 46 insertions, 0 deletions
diff --git a/llvm/lib/DebugInfo/PDB/Raw/GlobalsStream.cpp b/llvm/lib/DebugInfo/PDB/Raw/GlobalsStream.cpp
new file mode 100644
index 00000000000..c5184525d62
--- /dev/null
+++ b/llvm/lib/DebugInfo/PDB/Raw/GlobalsStream.cpp
@@ -0,0 +1,46 @@
+//===- GlobalsStream.cpp - PDB Index of Symbols by Name ---- ----*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#include "llvm/DebugInfo/PDB/Raw/GlobalsStream.h"
+
+#include "GSI.h"
+#include "llvm/DebugInfo/PDB/Raw/PDBFile.h"
+#include "llvm/DebugInfo/PDB/Raw/RawError.h"
+#include "llvm/DebugInfo/PDB/Raw/RawTypes.h"
+
+#include "llvm/Support/Endian.h"
+#include "llvm/Support/Error.h"
+
+using namespace llvm;
+using namespace llvm::msf;
+using namespace llvm::pdb;
+
+GlobalsStream::GlobalsStream(std::unique_ptr<MappedBlockStream> Stream)
+ : Stream(std::move(Stream)) {}
+
+GlobalsStream::~GlobalsStream() {}
+
+Error GlobalsStream::reload() {
+ StreamReader Reader(*Stream);
+
+ const GSIHashHeader *HashHdr;
+ if (auto EC = readGSIHashHeader(HashHdr, Reader))
+ return EC;
+
+ if (auto EC = readGSIHashRecords(HashRecords, HashHdr, Reader))
+ return EC;
+
+ if (auto EC = readGSIHashBuckets(HashBuckets, HashHdr, Reader))
+ return EC;
+ NumBuckets = HashBuckets.size();
+
+ return Error::success();
+}
+
+Error GlobalsStream::commit() { return Error::success(); }
OpenPOWER on IntegriCloud