Skip to content

Commit cc3a530

Browse files
committed
AST: Remove MemberLookupTable::updateLookupTable()
1 parent 3113c62 commit cc3a530

File tree

1 file changed

+0
-30
lines changed

1 file changed

+0
-30
lines changed

lib/AST/NameLookup.cpp

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1192,10 +1192,6 @@ void LazyConformanceLoader::anchor() {}
11921192
/// Lookup table used to store members of a nominal type (and its extensions)
11931193
/// for fast retrieval.
11941194
class swift::MemberLookupTable : public ASTAllocated<swift::MemberLookupTable> {
1195-
/// The last extension that was included within the member lookup table's
1196-
/// results.
1197-
ExtensionDecl *LastExtensionIncluded = nullptr;
1198-
11991195
/// The type of the internal lookup table.
12001196
typedef llvm::DenseMap<DeclName, llvm::TinyPtrVector<ValueDecl *>>
12011197
LookupTable;
@@ -1212,9 +1208,6 @@ class swift::MemberLookupTable : public ASTAllocated<swift::MemberLookupTable> {
12121208
/// Create a new member lookup table.
12131209
explicit MemberLookupTable(ASTContext &ctx);
12141210

1215-
/// Update a lookup table with members from newly-added extensions.
1216-
void updateLookupTable(NominalTypeDecl *nominal);
1217-
12181211
/// Add the given member to the lookup table.
12191212
void addMember(Decl *members);
12201213

@@ -1250,12 +1243,6 @@ class swift::MemberLookupTable : public ASTAllocated<swift::MemberLookupTable> {
12501243
}
12511244

12521245
void dump(llvm::raw_ostream &os) const {
1253-
os << "LastExtensionIncluded:\n";
1254-
if (LastExtensionIncluded)
1255-
LastExtensionIncluded->printContext(os, 2);
1256-
else
1257-
os << " nullptr\n";
1258-
12591246
os << "Lookup:\n ";
12601247
for (auto &pair : Lookup) {
12611248
pair.getFirst().print(os);
@@ -1357,22 +1344,6 @@ void MemberLookupTable::addMembers(DeclRange members) {
13571344
}
13581345
}
13591346

1360-
void MemberLookupTable::updateLookupTable(NominalTypeDecl *nominal) {
1361-
// If the last extension we included is the same as the last known extension,
1362-
// we're already up-to-date.
1363-
if (LastExtensionIncluded == nominal->LastExtension)
1364-
return;
1365-
1366-
// Add members from each of the extensions that we have not yet visited.
1367-
for (auto next = LastExtensionIncluded
1368-
? LastExtensionIncluded->NextExtension.getPointer()
1369-
: nominal->FirstExtension;
1370-
next;
1371-
(LastExtensionIncluded = next,next = next->NextExtension.getPointer())) {
1372-
addMembers(next->getMembers());
1373-
}
1374-
}
1375-
13761347
void NominalTypeDecl::addedExtension(ExtensionDecl *ext) {
13771348
auto *table = LookupTable.getPointer();
13781349

@@ -1619,7 +1590,6 @@ DirectLookupRequest::evaluate(Evaluator &evaluator,
16191590
for (auto E : decl->getExtensions())
16201591
(void)E->getMembers();
16211592

1622-
Table.updateLookupTable(decl);
16231593
} else if (!Table.isLazilyComplete(name.getBaseName())) {
16241594
DeclBaseName baseName(name.getBaseName());
16251595

0 commit comments

Comments
 (0)