1 //===- GlobalsStream.cpp - PDB Index of Symbols by Name ---- ----*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 #include "llvm/DebugInfo/PDB/Native/GlobalsStream.h"
12 #include "llvm/Support/BinaryStreamReader.h"
13 #include "llvm/Support/Error.h"
17 using namespace llvm::msf;
18 using namespace llvm::pdb;
20 GlobalsStream::GlobalsStream(std::unique_ptr<MappedBlockStream> Stream)
21 : Stream(std::move(Stream)) {}
23 GlobalsStream::~GlobalsStream() = default;
25 Error GlobalsStream::reload() {
26 BinaryStreamReader Reader(*Stream);
28 const GSIHashHeader *HashHdr;
29 if (auto EC = readGSIHashHeader(HashHdr, Reader))
32 if (auto EC = readGSIHashRecords(HashRecords, HashHdr, Reader))
35 if (auto EC = readGSIHashBuckets(HashBuckets, HashHdr, Reader))
37 NumBuckets = HashBuckets.size();
39 return Error::success();
42 Error GlobalsStream::commit() { return Error::success(); }