aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/DebugInfo/PDB/Native/HashTable.cpp
diff options
context:
space:
mode:
authorNAKAMURA Takumi <geek4civic@gmail.com>2017-02-25 17:04:23 +0000
committerNAKAMURA Takumi <geek4civic@gmail.com>2017-02-25 17:04:23 +0000
commit05a75e40da0f83639111687799eaab2c07c00ef0 (patch)
tree8ade745eed4316647c5098f24acd74af027ff364 /llvm/lib/DebugInfo/PDB/Native/HashTable.cpp
parent09ecd3117e151c645d2870409b5a78b2aeac326d (diff)
downloadllvm-05a75e40da0f83639111687799eaab2c07c00ef0.zip
llvm-05a75e40da0f83639111687799eaab2c07c00ef0.tar.gz
llvm-05a75e40da0f83639111687799eaab2c07c00ef0.tar.bz2
Revert r296215, "[PDB] General improvements to Stream library." and followings.
r296215, "[PDB] General improvements to Stream library." r296217, "Disable BinaryStreamTest.StreamReaderObject temporarily." r296220, "Re-enable BinaryStreamTest.StreamReaderObject." r296244, "[PDB] Disable some tests that are breaking bots." r296249, "Add static_cast to silence -Wc++11-narrowing." std::errc::no_buffer_space should be used for OS-oriented errors for socket transmission. (Seek discussions around llvm/xray.) I could substitute s/no_buffer_space/others/g, but I revert whole them ATM. Could we define and use LLVM errors there? llvm-svn: 296258
Diffstat (limited to 'llvm/lib/DebugInfo/PDB/Native/HashTable.cpp')
-rw-r--r--llvm/lib/DebugInfo/PDB/Native/HashTable.cpp24
1 files changed, 12 insertions, 12 deletions
diff --git a/llvm/lib/DebugInfo/PDB/Native/HashTable.cpp b/llvm/lib/DebugInfo/PDB/Native/HashTable.cpp
index ebf8c9c..dd95c07 100644
--- a/llvm/lib/DebugInfo/PDB/Native/HashTable.cpp
+++ b/llvm/lib/DebugInfo/PDB/Native/HashTable.cpp
@@ -22,7 +22,7 @@ HashTable::HashTable() : HashTable(8) {}
HashTable::HashTable(uint32_t Capacity) { Buckets.resize(Capacity); }
-Error HashTable::load(BinaryStreamReader &Stream) {
+Error HashTable::load(msf::StreamReader &Stream) {
const Header *H;
if (auto EC = Stream.readObject(H))
return EC;
@@ -48,9 +48,9 @@ Error HashTable::load(BinaryStreamReader &Stream) {
"Present bit vector interesects deleted!");
for (uint32_t P : Present) {
- if (auto EC = Stream.readInteger(Buckets[P].first))
+ if (auto EC = Stream.readInteger(Buckets[P].first, llvm::support::little))
return EC;
- if (auto EC = Stream.readInteger(Buckets[P].second))
+ if (auto EC = Stream.readInteger(Buckets[P].second, llvm::support::little))
return EC;
}
@@ -77,7 +77,7 @@ uint32_t HashTable::calculateSerializedLength() const {
return Size;
}
-Error HashTable::commit(BinaryStreamWriter &Writer) const {
+Error HashTable::commit(msf::StreamWriter &Writer) const {
Header H;
H.Size = size();
H.Capacity = capacity();
@@ -91,9 +91,9 @@ Error HashTable::commit(BinaryStreamWriter &Writer) const {
return EC;
for (const auto &Entry : *this) {
- if (auto EC = Writer.writeInteger(Entry.first))
+ if (auto EC = Writer.writeInteger(Entry.first, llvm::support::little))
return EC;
- if (auto EC = Writer.writeInteger(Entry.second))
+ if (auto EC = Writer.writeInteger(Entry.second, llvm::support::little))
return EC;
}
return Error::success();
@@ -209,10 +209,10 @@ void HashTable::grow() {
assert(size() == S);
}
-Error HashTable::readSparseBitVector(BinaryStreamReader &Stream,
+Error HashTable::readSparseBitVector(msf::StreamReader &Stream,
SparseBitVector<> &V) {
uint32_t NumWords;
- if (auto EC = Stream.readInteger(NumWords))
+ if (auto EC = Stream.readInteger(NumWords, llvm::support::little))
return joinErrors(
std::move(EC),
make_error<RawError>(raw_error_code::corrupt_file,
@@ -220,7 +220,7 @@ Error HashTable::readSparseBitVector(BinaryStreamReader &Stream,
for (uint32_t I = 0; I != NumWords; ++I) {
uint32_t Word;
- if (auto EC = Stream.readInteger(Word))
+ if (auto EC = Stream.readInteger(Word, llvm::support::little))
return joinErrors(std::move(EC),
make_error<RawError>(raw_error_code::corrupt_file,
"Expected hash table word"));
@@ -231,11 +231,11 @@ Error HashTable::readSparseBitVector(BinaryStreamReader &Stream,
return Error::success();
}
-Error HashTable::writeSparseBitVector(BinaryStreamWriter &Writer,
+Error HashTable::writeSparseBitVector(msf::StreamWriter &Writer,
SparseBitVector<> &Vec) {
int ReqBits = Vec.find_last() + 1;
uint32_t NumWords = alignTo(ReqBits, sizeof(uint32_t)) / sizeof(uint32_t);
- if (auto EC = Writer.writeInteger(NumWords))
+ if (auto EC = Writer.writeInteger(NumWords, llvm::support::little))
return joinErrors(
std::move(EC),
make_error<RawError>(raw_error_code::corrupt_file,
@@ -248,7 +248,7 @@ Error HashTable::writeSparseBitVector(BinaryStreamWriter &Writer,
if (Vec.test(Idx))
Word |= (1 << WordIdx);
}
- if (auto EC = Writer.writeInteger(Word))
+ if (auto EC = Writer.writeInteger(Word, llvm::support::little))
return joinErrors(std::move(EC), make_error<RawError>(
raw_error_code::corrupt_file,
"Could not write linear map word"));