forked from OSchip/llvm-project
[modules] Remove redundant information written into DeclContext name lookup tables. We don't need to store the data length twice.
llvm-svn: 243612
This commit is contained in:
parent
b74ba421fc
commit
f02662dec0
|
@ -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);
|
||||
|
|
|
@ -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>(
|
||||
|
|
Loading…
Reference in New Issue