summaryrefslogtreecommitdiffstats
path: root/clang/lib/Serialization/GlobalModuleIndex.cpp
diff options
context:
space:
mode:
authorPeter Collingbourne <peter@pcc.me.uk>2018-05-18 19:46:24 +0000
committerPeter Collingbourne <peter@pcc.me.uk>2018-05-18 19:46:24 +0000
commite3f652973e6e4fb7074b0bdc2291493e6cb8fae5 (patch)
tree4fba9f86235380483550bf1268b185f9aa2865f5 /clang/lib/Serialization/GlobalModuleIndex.cpp
parent1fa76cc3ea1f3361dd4e6091ac6a5c0e833de6a4 (diff)
downloadbcm5719-llvm-e3f652973e6e4fb7074b0bdc2291493e6cb8fae5.tar.gz
bcm5719-llvm-e3f652973e6e4fb7074b0bdc2291493e6cb8fae5.zip
Support: Simplify endian stream interface. NFCI.
Provide some free functions to reduce verbosity of endian-writing a single value, and replace the endianness template parameter with a field. Part of PR37466. Differential Revision: https://reviews.llvm.org/D47032 llvm-svn: 332757
Diffstat (limited to 'clang/lib/Serialization/GlobalModuleIndex.cpp')
-rw-r--r--clang/lib/Serialization/GlobalModuleIndex.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/clang/lib/Serialization/GlobalModuleIndex.cpp b/clang/lib/Serialization/GlobalModuleIndex.cpp
index 00cd182d853..3733638d297 100644
--- a/clang/lib/Serialization/GlobalModuleIndex.cpp
+++ b/clang/lib/Serialization/GlobalModuleIndex.cpp
@@ -703,7 +703,7 @@ public:
std::pair<unsigned,unsigned>
EmitKeyDataLength(raw_ostream& Out, key_type_ref Key, data_type_ref Data) {
using namespace llvm::support;
- endian::Writer<little> LE(Out);
+ endian::Writer LE(Out, little);
unsigned KeyLen = Key.size();
unsigned DataLen = Data.size() * 4;
LE.write<uint16_t>(KeyLen);
@@ -719,7 +719,7 @@ public:
unsigned DataLen) {
using namespace llvm::support;
for (unsigned I = 0, N = Data.size(); I != N; ++I)
- endian::Writer<little>(Out).write<uint32_t>(Data[I]);
+ endian::write<uint32_t>(Out, Data[I], little);
}
};
@@ -797,7 +797,7 @@ bool GlobalModuleIndexBuilder::writeIndex(llvm::BitstreamWriter &Stream) {
using namespace llvm::support;
llvm::raw_svector_ostream Out(IdentifierTable);
// Make sure that no bucket is at offset 0
- endian::Writer<little>(Out).write<uint32_t>(0);
+ endian::write<uint32_t>(Out, 0, little);
BucketOffset = Generator.Emit(Out, Trait);
}
OpenPOWER on IntegriCloud