diff options
| author | Richard Smith <richard-llvm@metafoo.co.uk> | 2015-07-30 03:17:16 +0000 |
|---|---|---|
| committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2015-07-30 03:17:16 +0000 |
| commit | f02662dec0673b9f35adc518820d85e181b3494a (patch) | |
| tree | 7803d7693855177481f21417c4cdf756c528f676 /clang/lib | |
| parent | b74ba421fc9f8d8e1d5e52bb1566ecb705a3029b (diff) | |
| download | bcm5719-llvm-f02662dec0673b9f35adc518820d85e181b3494a.tar.gz bcm5719-llvm-f02662dec0673b9f35adc518820d85e181b3494a.zip | |
[modules] Remove redundant information written into DeclContext name lookup tables. We don't need to store the data length twice.
llvm-svn: 243612
Diffstat (limited to 'clang/lib')
| -rw-r--r-- | clang/lib/Serialization/ASTReader.cpp | 8 | ||||
| -rw-r--r-- | clang/lib/Serialization/ASTWriter.cpp | 5 |
2 files changed, 6 insertions, 7 deletions
diff --git a/clang/lib/Serialization/ASTReader.cpp b/clang/lib/Serialization/ASTReader.cpp index 0c4dab4065b..e5548fd7197 100644 --- a/clang/lib/Serialization/ASTReader.cpp +++ b/clang/lib/Serialization/ASTReader.cpp @@ -944,12 +944,12 @@ ASTDeclContextNameLookupTrait::ReadKey(const unsigned char* d, unsigned) { return Key; } -ASTDeclContextNameLookupTrait::data_type -ASTDeclContextNameLookupTrait::ReadData(internal_key_type, - const unsigned char* d, +ASTDeclContextNameLookupTrait::data_type +ASTDeclContextNameLookupTrait::ReadData(internal_key_type, + const unsigned char *d, unsigned DataLen) { using namespace llvm::support; - unsigned NumDecls = endian::readNext<uint16_t, little, unaligned>(d); + unsigned NumDecls = DataLen / 4; LE32DeclID *Start = reinterpret_cast<LE32DeclID *>( const_cast<unsigned char *>(d)); return std::make_pair(Start, Start + NumDecls); diff --git a/clang/lib/Serialization/ASTWriter.cpp b/clang/lib/Serialization/ASTWriter.cpp index ba8e1a85107..f1c907394bf 100644 --- a/clang/lib/Serialization/ASTWriter.cpp +++ b/clang/lib/Serialization/ASTWriter.cpp @@ -3415,8 +3415,8 @@ public: } LE.write<uint16_t>(KeyLen); - // 2 bytes for num of decls and 4 for each DeclID. - unsigned DataLen = 2 + 4 * Lookup.size(); + // 4 bytes for each DeclID. + unsigned DataLen = 4 * Lookup.size(); LE.write<uint16_t>(DataLen); return std::make_pair(KeyLen, DataLen); @@ -3458,7 +3458,6 @@ public: using namespace llvm::support; endian::Writer<little> LE(Out); uint64_t Start = Out.tell(); (void)Start; - LE.write<uint16_t>(Lookup.size()); for (DeclContext::lookup_iterator I = Lookup.begin(), E = Lookup.end(); I != E; ++I) LE.write<uint32_t>( |

