summaryrefslogtreecommitdiff
path: root/lib/Serialization/GlobalModuleIndex.cpp
diff options
context:
space:
mode:
authorJustin Bogner <mail@justinbogner.com>2014-03-28 22:03:24 +0000
committerJustin Bogner <mail@justinbogner.com>2014-03-28 22:03:24 +0000
commitd60a851dd59b8888acbd9e1a917ac4e8802a4729 (patch)
tree0e979a7088c67652b2e481c556bc9880cdfbb1c4 /lib/Serialization/GlobalModuleIndex.cpp
parent73433a87fa9458b99a92a8f88a27ef47ff0d0ded (diff)
downloadclang-d60a851dd59b8888acbd9e1a917ac4e8802a4729.tar.gz
clang-d60a851dd59b8888acbd9e1a917ac4e8802a4729.tar.bz2
clang-d60a851dd59b8888acbd9e1a917ac4e8802a4729.tar.xz
Reapply "OnDiskHashTable: Use Endian.h to read little endian ostreams"
Committed this by accident before it was done last time. Original message: Rather than rolling our own functions to read little endian data from a buffer, we can use the support in llvm's Endian.h. No functional change. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@205062 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Serialization/GlobalModuleIndex.cpp')
-rw-r--r--lib/Serialization/GlobalModuleIndex.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/lib/Serialization/GlobalModuleIndex.cpp b/lib/Serialization/GlobalModuleIndex.cpp
index b479361012..14b149f078 100644
--- a/lib/Serialization/GlobalModuleIndex.cpp
+++ b/lib/Serialization/GlobalModuleIndex.cpp
@@ -82,9 +82,9 @@ public:
static std::pair<unsigned, unsigned>
ReadKeyDataLength(const unsigned char*& d) {
- using namespace clang::io;
- unsigned KeyLen = ReadUnalignedLE16(d);
- unsigned DataLen = ReadUnalignedLE16(d);
+ using namespace llvm::support;
+ unsigned KeyLen = endian::readNext<uint16_t, little, unaligned>(d);
+ unsigned DataLen = endian::readNext<uint16_t, little, unaligned>(d);
return std::make_pair(KeyLen, DataLen);
}
@@ -101,11 +101,11 @@ public:
static data_type ReadData(const internal_key_type& k,
const unsigned char* d,
unsigned DataLen) {
- using namespace clang::io;
+ using namespace llvm::support;
data_type Result;
while (DataLen > 0) {
- unsigned ID = ReadUnalignedLE32(d);
+ unsigned ID = endian::readNext<uint32_t, little, unaligned>(d);
Result.push_back(ID);
DataLen -= 4;
}
@@ -459,8 +459,8 @@ namespace {
unsigned DataLen) {
// The first bit indicates whether this identifier is interesting.
// That's all we care about.
- using namespace clang::io;
- unsigned RawID = ReadUnalignedLE32(d);
+ using namespace llvm::support;
+ unsigned RawID = endian::readNext<uint32_t, little, unaligned>(d);
bool IsInteresting = RawID & 0x01;
return std::make_pair(k, IsInteresting);
}