diff --git a/lib/AST/NameLookup.cpp b/lib/AST/NameLookup.cpp index 0d76213cfd562..96f27d167ca23 100644 --- a/lib/AST/NameLookup.cpp +++ b/lib/AST/NameLookup.cpp @@ -980,9 +980,6 @@ class swift::MemberLookupTable { /// Create a new member lookup table. explicit MemberLookupTable(ASTContext &ctx); - /// Destroy the lookup table. - void destroy(); - /// Update a lookup table with members from newly-added extensions. void updateLookupTable(NominalTypeDecl *nominal); @@ -1039,10 +1036,6 @@ class ClassDecl::ObjCMethodLookupTable StoredObjCMethods> { public: - void destroy() { - this->~ObjCMethodLookupTable(); - } - // Only allow allocation of member lookup tables using the allocator in // ASTContext or by doing a placement new. void *operator new(size_t Bytes, ASTContext &C, @@ -1059,7 +1052,7 @@ MemberLookupTable::MemberLookupTable(ASTContext &ctx) { // Register a cleanup with the ASTContext to call the lookup table // destructor. ctx.addCleanup([this]() { - this->destroy(); + this->~MemberLookupTable(); }); } @@ -1127,10 +1120,6 @@ void MemberLookupTable::updateLookupTable(NominalTypeDecl *nominal) { } } -void MemberLookupTable::destroy() { - this->~MemberLookupTable(); -} - void NominalTypeDecl::addedMember(Decl *member) { // If we have a lookup table, add the new member to it. if (LookupTable.getPointer()) { @@ -1218,7 +1207,7 @@ void ClassDecl::createObjCMethodLookup() { // Register a cleanup with the ASTContext to call the lookup table // destructor. ctx.addCleanup([this]() { - this->ObjCMethodLookup->destroy(); + this->ObjCMethodLookup->~ObjCMethodLookupTable(); }); }