summaryrefslogtreecommitdiffstats
path: root/llvm/lib/DebugInfo/PDB/Native/GlobalsStream.cpp
diff options
context:
space:
mode:
authorAdrian McCarthy <amccarth@google.com>2017-01-25 22:38:55 +0000
committerAdrian McCarthy <amccarth@google.com>2017-01-25 22:38:55 +0000
commit6b6b8c4fb9de06aecef40b8aadcc92dfbfec2e33 (patch)
treecdef766dc0d3728f643359f40671078727d9487e /llvm/lib/DebugInfo/PDB/Native/GlobalsStream.cpp
parent896b4513e1bb1a96192b71db9da3ed7955778346 (diff)
downloadbcm5719-llvm-6b6b8c4fb9de06aecef40b8aadcc92dfbfec2e33.tar.gz
bcm5719-llvm-6b6b8c4fb9de06aecef40b8aadcc92dfbfec2e33.zip
NFC: Rename (PDB) RawSession to NativeSession
This eliminates one overload on the term Raw. Differential Revision: https://reviews.llvm.org/D29098 llvm-svn: 293104
Diffstat (limited to 'llvm/lib/DebugInfo/PDB/Native/GlobalsStream.cpp')
-rw-r--r--llvm/lib/DebugInfo/PDB/Native/GlobalsStream.cpp42
1 files changed, 42 insertions, 0 deletions
diff --git a/llvm/lib/DebugInfo/PDB/Native/GlobalsStream.cpp b/llvm/lib/DebugInfo/PDB/Native/GlobalsStream.cpp
new file mode 100644
index 00000000000..2f204ed0190
--- /dev/null
+++ b/llvm/lib/DebugInfo/PDB/Native/GlobalsStream.cpp
@@ -0,0 +1,42 @@
+//===- 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/Native/GlobalsStream.h"
+#include "GSI.h"
+#include "llvm/DebugInfo/MSF/StreamReader.h"
+#include "llvm/Support/Error.h"
+#include <algorithm>
+
+using namespace llvm;
+using namespace llvm::msf;
+using namespace llvm::pdb;
+
+GlobalsStream::GlobalsStream(std::unique_ptr<MappedBlockStream> Stream)
+ : Stream(std::move(Stream)) {}
+
+GlobalsStream::~GlobalsStream() = default;
+
+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