Skip to content

Commit 3f66608

Browse files
committed
Check for stubs in NeedsNewVTableEntryRequest
This lets us remove `setNeedsNewVTableEntry`.
1 parent c1a1ddd commit 3f66608

File tree

3 files changed

+4
-7
lines changed

3 files changed

+4
-7
lines changed

include/swift/AST/Decl.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5824,11 +5824,6 @@ class AbstractFunctionDecl : public GenericContext, public ValueDecl {
58245824
return getBodyKind() == BodyKind::MemberwiseInitializer;
58255825
}
58265826

5827-
void setNeedsNewVTableEntry(bool value) {
5828-
LazySemanticInfo.NeedsNewVTableEntryComputed = true;
5829-
LazySemanticInfo.NeedsNewVTableEntry = value;
5830-
}
5831-
58325827
/// For a method of a class, checks whether it will require a new entry in the
58335828
/// vtable.
58345829
bool needsNewVTableEntry() const;

lib/Sema/CodeSynthesis.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -702,8 +702,6 @@ createDesignatedInitOverride(ClassDecl *classDecl,
702702
// Note that this is a stub implementation.
703703
ctor->setStubImplementation(true);
704704

705-
// Stub constructors don't appear in the vtable.
706-
ctor->setNeedsNewVTableEntry(false);
707705
return ctor;
708706
}
709707

lib/Sema/TypeCheckDecl.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1392,6 +1392,10 @@ NeedsNewVTableEntryRequest::evaluate(Evaluator &evaluator,
13921392
if (!ctor->isRequired() && !ctor->isDesignatedInit()) {
13931393
return false;
13941394
}
1395+
1396+
// Stub constructors don't appear in the vtable.
1397+
if (ctor->hasStubImplementation())
1398+
return false;
13951399
}
13961400

13971401
if (auto *accessor = dyn_cast<AccessorDecl>(decl)) {

0 commit comments

Comments
 (0)