[serialization] Handle overloaded decls.

Swift SVN r6230
This commit is contained in:
Jordan Rose
2013-07-13 00:03:14 +00:00
parent f19de086ca
commit 1712ee6661
2 changed files with 8 additions and 5 deletions

View File

@@ -1959,7 +1959,7 @@ void ModuleFile::buildTopLevelDeclMap() {
for (DeclID ID : RawTopLevelIDs) {
// FIXME: Right now ExtensionDecls are in here as well.
if (auto value = dyn_cast<ValueDecl>(getDecl(ID)))
TopLevelIDs[value->getName()] = ID;
TopLevelDecls[value->getName()].push_back(value);
}
RawTopLevelIDs.clear();
@@ -1967,8 +1967,11 @@ void ModuleFile::buildTopLevelDeclMap() {
void ModuleFile::lookupValue(Identifier name,
SmallVectorImpl<ValueDecl*> &results) {
if (DeclID ID = TopLevelIDs.lookup(name))
results.push_back(cast<ValueDecl>(getDecl(ID)));
auto iter = TopLevelDecls.find(name);
if (iter == TopLevelDecls.end())
return;
results.append(iter->second.begin(), iter->second.end());
}
OperatorKind getOperatorKind(DeclKind kind) {