summaryrefslogtreecommitdiffstats
path: root/llvm/lib/DebugInfo/PDB
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/DebugInfo/PDB')
-rw-r--r--llvm/lib/DebugInfo/PDB/Native/DbiStream.cpp2
-rw-r--r--llvm/lib/DebugInfo/PDB/Native/DbiStreamBuilder.cpp20
-rw-r--r--llvm/lib/DebugInfo/PDB/Native/HashTable.cpp16
-rw-r--r--llvm/lib/DebugInfo/PDB/Native/ModStream.cpp4
-rw-r--r--llvm/lib/DebugInfo/PDB/Native/NamedStreamMap.cpp6
-rw-r--r--llvm/lib/DebugInfo/PDB/Native/PDBFile.cpp2
-rw-r--r--llvm/lib/DebugInfo/PDB/Native/PDBFileBuilder.cpp4
-rw-r--r--llvm/lib/DebugInfo/PDB/Native/StringTable.cpp2
-rw-r--r--llvm/lib/DebugInfo/PDB/Native/StringTableBuilder.cpp5
9 files changed, 34 insertions, 27 deletions
diff --git a/llvm/lib/DebugInfo/PDB/Native/DbiStream.cpp b/llvm/lib/DebugInfo/PDB/Native/DbiStream.cpp
index 5d15e62d3e4..f2f25c2bfeb 100644
--- a/llvm/lib/DebugInfo/PDB/Native/DbiStream.cpp
+++ b/llvm/lib/DebugInfo/PDB/Native/DbiStream.cpp
@@ -236,7 +236,7 @@ Error DbiStream::initializeSectionContributionData() {
return Error::success();
StreamReader SCReader(SecContrSubstream);
- if (auto EC = SCReader.readEnum(SectionContribVersion))
+ if (auto EC = SCReader.readEnum(SectionContribVersion, llvm::support::little))
return EC;
if (SectionContribVersion == DbiSecContribVer60)
diff --git a/llvm/lib/DebugInfo/PDB/Native/DbiStreamBuilder.cpp b/llvm/lib/DebugInfo/PDB/Native/DbiStreamBuilder.cpp
index df6e9b060df..0b56d05b468 100644
--- a/llvm/lib/DebugInfo/PDB/Native/DbiStreamBuilder.cpp
+++ b/llvm/lib/DebugInfo/PDB/Native/DbiStreamBuilder.cpp
@@ -187,17 +187,21 @@ Error DbiStreamBuilder::generateFileInfoSubstream() {
uint16_t ModiCount = std::min<uint32_t>(UINT16_MAX, ModuleInfos.size());
uint16_t FileCount = std::min<uint32_t>(UINT16_MAX, SourceFileNames.size());
- if (auto EC = MetadataWriter.writeInteger(ModiCount)) // NumModules
+ if (auto EC = MetadataWriter.writeInteger(
+ ModiCount, llvm::support::little)) // NumModules
return EC;
- if (auto EC = MetadataWriter.writeInteger(FileCount)) // NumSourceFiles
+ if (auto EC = MetadataWriter.writeInteger(
+ FileCount, llvm::support::little)) // NumSourceFiles
return EC;
for (uint16_t I = 0; I < ModiCount; ++I) {
- if (auto EC = MetadataWriter.writeInteger(I)) // Mod Indices
+ if (auto EC = MetadataWriter.writeInteger(
+ I, llvm::support::little)) // Mod Indices
return EC;
}
for (const auto MI : ModuleInfoList) {
FileCount = static_cast<uint16_t>(MI->SourceFiles.size());
- if (auto EC = MetadataWriter.writeInteger(FileCount)) // Mod File Counts
+ if (auto EC = MetadataWriter.writeInteger(
+ FileCount, llvm::support::little)) // Mod File Counts
return EC;
}
@@ -219,7 +223,8 @@ Error DbiStreamBuilder::generateFileInfoSubstream() {
if (Result == SourceFileNames.end())
return make_error<RawError>(raw_error_code::no_entry,
"The source file was not found.");
- if (auto EC = MetadataWriter.writeInteger(Result->second))
+ if (auto EC = MetadataWriter.writeInteger(Result->second,
+ llvm::support::little))
return EC;
}
}
@@ -373,7 +378,7 @@ Error DbiStreamBuilder::commit(const msf::MSFLayout &Layout,
return EC;
if (!SectionContribs.empty()) {
- if (auto EC = Writer.writeEnum(DbiSecContribVer60))
+ if (auto EC = Writer.writeEnum(DbiSecContribVer60, llvm::support::little))
return EC;
if (auto EC = Writer.writeArray(SectionContribs))
return EC;
@@ -392,7 +397,8 @@ Error DbiStreamBuilder::commit(const msf::MSFLayout &Layout,
return EC;
for (auto &Stream : DbgStreams)
- if (auto EC = Writer.writeInteger(Stream.StreamNumber))
+ if (auto EC =
+ Writer.writeInteger(Stream.StreamNumber, llvm::support::little))
return EC;
for (auto &Stream : DbgStreams) {
diff --git a/llvm/lib/DebugInfo/PDB/Native/HashTable.cpp b/llvm/lib/DebugInfo/PDB/Native/HashTable.cpp
index b3fe6fa45c5..dd95c078d7e 100644
--- a/llvm/lib/DebugInfo/PDB/Native/HashTable.cpp
+++ b/llvm/lib/DebugInfo/PDB/Native/HashTable.cpp
@@ -48,9 +48,9 @@ Error HashTable::load(msf::StreamReader &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;
}
@@ -91,9 +91,9 @@ Error HashTable::commit(msf::StreamWriter &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();
@@ -212,7 +212,7 @@ void HashTable::grow() {
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(msf::StreamReader &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"));
@@ -235,7 +235,7 @@ 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(msf::StreamWriter &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"));
diff --git a/llvm/lib/DebugInfo/PDB/Native/ModStream.cpp b/llvm/lib/DebugInfo/PDB/Native/ModStream.cpp
index 25370f26ec3..ee8374ff120 100644
--- a/llvm/lib/DebugInfo/PDB/Native/ModStream.cpp
+++ b/llvm/lib/DebugInfo/PDB/Native/ModStream.cpp
@@ -43,7 +43,7 @@ Error ModStream::reload() {
ReadableStreamRef S;
- if (auto EC = Reader.readInteger(Signature))
+ if (auto EC = Reader.readInteger(Signature, llvm::support::little))
return EC;
if (auto EC = Reader.readArray(SymbolsSubstream, SymbolSize - 4))
return EC;
@@ -58,7 +58,7 @@ Error ModStream::reload() {
return EC;
uint32_t GlobalRefsSize;
- if (auto EC = Reader.readInteger(GlobalRefsSize))
+ if (auto EC = Reader.readInteger(GlobalRefsSize, llvm::support::little))
return EC;
if (auto EC = Reader.readStreamRef(GlobalRefsSubstream, GlobalRefsSize))
return EC;
diff --git a/llvm/lib/DebugInfo/PDB/Native/NamedStreamMap.cpp b/llvm/lib/DebugInfo/PDB/Native/NamedStreamMap.cpp
index 47fd0e1ba24..8a9579ca385 100644
--- a/llvm/lib/DebugInfo/PDB/Native/NamedStreamMap.cpp
+++ b/llvm/lib/DebugInfo/PDB/Native/NamedStreamMap.cpp
@@ -32,7 +32,7 @@ Error NamedStreamMap::load(StreamReader &Stream) {
FinalizedInfo.reset();
uint32_t StringBufferSize;
- if (auto EC = Stream.readInteger(StringBufferSize))
+ if (auto EC = Stream.readInteger(StringBufferSize, llvm::support::little))
return joinErrors(std::move(EC),
make_error<RawError>(raw_error_code::corrupt_file,
"Expected string buffer size"));
@@ -71,8 +71,8 @@ Error NamedStreamMap::commit(msf::StreamWriter &Writer) const {
assert(FinalizedInfo.hasValue());
// The first field is the number of bytes of string data.
- if (auto EC = Writer.writeInteger(
- FinalizedInfo->StringDataBytes)) // Number of bytes of string data
+ if (auto EC = Writer.writeInteger(FinalizedInfo->StringDataBytes,
+ llvm::support::little))
return EC;
// Now all of the string data itself.
diff --git a/llvm/lib/DebugInfo/PDB/Native/PDBFile.cpp b/llvm/lib/DebugInfo/PDB/Native/PDBFile.cpp
index 3a3692dcac5..26d9e0ee9e9 100644
--- a/llvm/lib/DebugInfo/PDB/Native/PDBFile.cpp
+++ b/llvm/lib/DebugInfo/PDB/Native/PDBFile.cpp
@@ -186,7 +186,7 @@ Error PDBFile::parseStreamData() {
// been parsed, we can avoid this and reuse MappedBlockStream.
auto DS = MappedBlockStream::createDirectoryStream(ContainerLayout, *Buffer);
StreamReader Reader(*DS);
- if (auto EC = Reader.readInteger(NumStreams))
+ if (auto EC = Reader.readInteger(NumStreams, llvm::support::little))
return EC;
if (auto EC = Reader.readArray(ContainerLayout.StreamSizes, NumStreams))
diff --git a/llvm/lib/DebugInfo/PDB/Native/PDBFileBuilder.cpp b/llvm/lib/DebugInfo/PDB/Native/PDBFileBuilder.cpp
index 57ca2ba488a..fb8e34e7e82 100644
--- a/llvm/lib/DebugInfo/PDB/Native/PDBFileBuilder.cpp
+++ b/llvm/lib/DebugInfo/PDB/Native/PDBFileBuilder.cpp
@@ -132,8 +132,8 @@ Error PDBFileBuilder::commit(StringRef Filename) {
auto DirStream =
WritableMappedBlockStream::createDirectoryStream(Layout, Buffer);
StreamWriter DW(*DirStream);
- if (auto EC =
- DW.writeInteger(static_cast<uint32_t>(Layout.StreamSizes.size())))
+ if (auto EC = DW.writeInteger<uint32_t>(Layout.StreamSizes.size(),
+ llvm::support::little))
return EC;
if (auto EC = DW.writeArray(Layout.StreamSizes))
diff --git a/llvm/lib/DebugInfo/PDB/Native/StringTable.cpp b/llvm/lib/DebugInfo/PDB/Native/StringTable.cpp
index 5b8ae9b7e9c..34f2b480260 100644
--- a/llvm/lib/DebugInfo/PDB/Native/StringTable.cpp
+++ b/llvm/lib/DebugInfo/PDB/Native/StringTable.cpp
@@ -55,7 +55,7 @@ Error StringTable::load(StreamReader &Stream) {
return make_error<RawError>(raw_error_code::corrupt_file,
"Missing name count");
- if (auto EC = Stream.readInteger(NameCount))
+ if (auto EC = Stream.readInteger(NameCount, llvm::support::little))
return EC;
return Error::success();
}
diff --git a/llvm/lib/DebugInfo/PDB/Native/StringTableBuilder.cpp b/llvm/lib/DebugInfo/PDB/Native/StringTableBuilder.cpp
index ef9caee4cd6..304f3a6ed11 100644
--- a/llvm/lib/DebugInfo/PDB/Native/StringTableBuilder.cpp
+++ b/llvm/lib/DebugInfo/PDB/Native/StringTableBuilder.cpp
@@ -74,7 +74,7 @@ Error StringTableBuilder::commit(msf::StreamWriter &Writer) const {
// Write a hash table.
uint32_t BucketCount = computeBucketCount(Strings.size());
- if (auto EC = Writer.writeInteger(BucketCount))
+ if (auto EC = Writer.writeInteger(BucketCount, llvm::support::little))
return EC;
std::vector<ulittle32_t> Buckets(BucketCount);
@@ -96,7 +96,8 @@ Error StringTableBuilder::commit(msf::StreamWriter &Writer) const {
if (auto EC = Writer.writeArray(ArrayRef<ulittle32_t>(Buckets)))
return EC;
- if (auto EC = Writer.writeInteger(static_cast<uint32_t>(Strings.size())))
+ if (auto EC = Writer.writeInteger(static_cast<uint32_t>(Strings.size()),
+ llvm::support::little))
return EC;
return Error::success();
}
OpenPOWER on IntegriCloud