summaryrefslogtreecommitdiffstats
path: root/llvm/lib/DebugInfo/PDB/Native/StringTableBuilder.cpp
diff options
context:
space:
mode:
authorZachary Turner <zturner@google.com>2017-02-28 00:04:07 +0000
committerZachary Turner <zturner@google.com>2017-02-28 00:04:07 +0000
commit695ed56ba5d3bd3b86c6a4ed6d79b89eb8fbd2f4 (patch)
treecaf35bd7345bb071545ef39b636b40ffafc41504 /llvm/lib/DebugInfo/PDB/Native/StringTableBuilder.cpp
parent59cd89332010b22e82c3110d558ff37948c4df1e (diff)
downloadbcm5719-llvm-695ed56ba5d3bd3b86c6a4ed6d79b89eb8fbd2f4.tar.gz
bcm5719-llvm-695ed56ba5d3bd3b86c6a4ed6d79b89eb8fbd2f4.zip
[PDB] Make streams carry their own endianness.
Before the endianness was specified on each call to read or write of the StreamReader / StreamWriter, but in practice it's extremely rare for streams to have data encoded in multiple different endiannesses, so we should optimize for the 99% use case. This makes the code cleaner and more general, but otherwise has NFC. llvm-svn: 296415
Diffstat (limited to 'llvm/lib/DebugInfo/PDB/Native/StringTableBuilder.cpp')
-rw-r--r--llvm/lib/DebugInfo/PDB/Native/StringTableBuilder.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/llvm/lib/DebugInfo/PDB/Native/StringTableBuilder.cpp b/llvm/lib/DebugInfo/PDB/Native/StringTableBuilder.cpp
index 5432fe4b99e..9df97c9753e 100644
--- a/llvm/lib/DebugInfo/PDB/Native/StringTableBuilder.cpp
+++ b/llvm/lib/DebugInfo/PDB/Native/StringTableBuilder.cpp
@@ -74,7 +74,7 @@ Error StringTableBuilder::commit(BinaryStreamWriter &Writer) const {
// Write a hash table.
uint32_t BucketCount = computeBucketCount(Strings.size());
- if (auto EC = Writer.writeInteger(BucketCount, llvm::support::little))
+ if (auto EC = Writer.writeInteger(BucketCount))
return EC;
std::vector<ulittle32_t> Buckets(BucketCount);
@@ -96,8 +96,7 @@ Error StringTableBuilder::commit(BinaryStreamWriter &Writer) const {
if (auto EC = Writer.writeArray(ArrayRef<ulittle32_t>(Buckets)))
return EC;
- if (auto EC = Writer.writeInteger(static_cast<uint32_t>(Strings.size()),
- llvm::support::little))
+ if (auto EC = Writer.writeInteger(static_cast<uint32_t>(Strings.size())))
return EC;
return Error::success();
}
OpenPOWER on IntegriCloud