Merge remote-tracking branch 'origin/master' into master-next

This commit is contained in:
swift-ci
2018-05-11 01:49:13 -07:00
22 changed files with 574 additions and 43 deletions

View File

@@ -432,7 +432,7 @@ class ModuleFile::LocalDeclTableInfo {
public:
using internal_key_type = StringRef;
using external_key_type = internal_key_type;
using data_type = std::pair<DeclID, unsigned>; // ID, local discriminator
using data_type = DeclID;
using hash_value_type = uint32_t;
using offset_type = unsigned;
@@ -451,7 +451,7 @@ public:
static std::pair<unsigned, unsigned> ReadKeyDataLength(const uint8_t *&data) {
unsigned keyLength = endian::readNext<uint16_t, little, unaligned>(data);
return { keyLength, sizeof(uint32_t) + sizeof(unsigned) };
return { keyLength, sizeof(uint32_t) };
}
static internal_key_type ReadKey(const uint8_t *data, unsigned length) {
@@ -460,9 +460,7 @@ public:
static data_type ReadData(internal_key_type key, const uint8_t *data,
unsigned length) {
auto declID = endian::readNext<uint32_t, little, unaligned>(data);
auto discriminator = endian::readNext<unsigned, little, unaligned>(data);
return { declID, discriminator };
return endian::readNext<uint32_t, little, unaligned>(data);
}
};
@@ -1524,7 +1522,7 @@ TypeDecl *ModuleFile::lookupLocalType(StringRef MangledName) {
if (iter == LocalTypeDecls->end())
return nullptr;
return cast<TypeDecl>(getDecl((*iter).first));
return cast<TypeDecl>(getDecl(*iter));
}
TypeDecl *ModuleFile::lookupNestedType(Identifier name,
@@ -2029,10 +2027,8 @@ ModuleFile::getLocalTypeDecls(SmallVectorImpl<TypeDecl *> &results) {
if (!LocalTypeDecls)
return;
for (auto entry : LocalTypeDecls->data()) {
auto DeclID = entry.first;
for (auto DeclID : LocalTypeDecls->data()) {
auto TD = cast<TypeDecl>(getDecl(DeclID));
TD->setLocalDiscriminator(entry.second);
results.push_back(TD);
}
}