summaryrefslogtreecommitdiffstats
path: root/llvm/lib/DebugInfo/PDB/Native/StringTable.cpp
diff options
context:
space:
mode:
authorZachary Turner <zturner@google.com>2017-02-27 22:11:43 +0000
committerZachary Turner <zturner@google.com>2017-02-27 22:11:43 +0000
commit120faca41bddd3a5922bdefbeb7c68908fda9ab9 (patch)
treee3c36b67c61a5021ed8847241cfaf9c59b48309a /llvm/lib/DebugInfo/PDB/Native/StringTable.cpp
parent4a7cc16e89b68d48335e7cd19837c3e67e12afb2 (diff)
downloadbcm5719-llvm-120faca41bddd3a5922bdefbeb7c68908fda9ab9.tar.gz
bcm5719-llvm-120faca41bddd3a5922bdefbeb7c68908fda9ab9.zip
[PDB] Partial resubmit of r296215, which improved PDB Stream Library.
This was reverted because it was breaking some builds, and because of incorrect error code usage. Since the CL was large and contained many different things, I'm resubmitting it in pieces. This portion is NFC, and consists of: 1) Renaming classes to follow a consistent naming convention. 2) Fixing the const-ness of the interface methods. 3) Adding detailed doxygen comments. 4) Fixing a few instances of passing `const BinaryStream& X`. These are now passed as `BinaryStreamRef X`. llvm-svn: 296394
Diffstat (limited to 'llvm/lib/DebugInfo/PDB/Native/StringTable.cpp')
-rw-r--r--llvm/lib/DebugInfo/PDB/Native/StringTable.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/llvm/lib/DebugInfo/PDB/Native/StringTable.cpp b/llvm/lib/DebugInfo/PDB/Native/StringTable.cpp
index c81bff48191..e2b9ea20812 100644
--- a/llvm/lib/DebugInfo/PDB/Native/StringTable.cpp
+++ b/llvm/lib/DebugInfo/PDB/Native/StringTable.cpp
@@ -17,13 +17,12 @@
#include "llvm/Support/Endian.h"
using namespace llvm;
-using namespace llvm::msf;
using namespace llvm::support;
using namespace llvm::pdb;
StringTable::StringTable() : Signature(0), HashVersion(0), NameCount(0) {}
-Error StringTable::load(StreamReader &Stream) {
+Error StringTable::load(BinaryStreamReader &Stream) {
const StringTableHeader *H;
if (auto EC = Stream.readObject(H))
return EC;
@@ -68,9 +67,9 @@ StringRef StringTable::getStringForID(uint32_t ID) const {
// the starting offset of the string we're looking for. So just seek into
// the desired offset and a read a null terminated stream from that offset.
StringRef Result;
- StreamReader NameReader(NamesBuffer);
+ BinaryStreamReader NameReader(NamesBuffer);
NameReader.setOffset(ID);
- if (auto EC = NameReader.readZeroString(Result))
+ if (auto EC = NameReader.readCString(Result))
consumeError(std::move(EC));
return Result;
}
OpenPOWER on IntegriCloud