Skip to content

Simplify lookup table cleanup code. No functionality change. #7724

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 23, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 2 additions & 13 deletions lib/AST/NameLookup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down Expand Up @@ -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,
Expand All @@ -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();
});
}

Expand Down Expand Up @@ -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()) {
Expand Down Expand Up @@ -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();
});
}

Expand Down