Skip to content

Commit 05baaa8

Browse files
committed
AST: Slightly more efficient requiresNewVTableEntry()
1 parent 2e3f4ac commit 05baaa8

File tree

1 file changed

+11
-14
lines changed

1 file changed

+11
-14
lines changed

lib/AST/Decl.cpp

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -6463,13 +6463,6 @@ static bool requiresNewVTableEntry(const AbstractFunctionDecl *decl) {
64636463

64646464
auto &ctx = dc->getASTContext();
64656465

6466-
// FIXME: Remove this once getInterfaceType(), isDesignatedInit() and
6467-
// anything else that is used below has been request-ified.
6468-
if (!decl->hasInterfaceType()) {
6469-
ctx.getLazyResolver()->resolveDeclSignature(
6470-
const_cast<AbstractFunctionDecl *>(decl));
6471-
}
6472-
64736466
// Initializers are not normally inherited, but required initializers can
64746467
// be overridden for invocation from dynamic types, and convenience initializers
64756468
// are conditionally inherited when all designated initializers are available,
@@ -6494,13 +6487,6 @@ static bool requiresNewVTableEntry(const AbstractFunctionDecl *decl) {
64946487
if (!base || base->hasClangNode() || base->isObjCDynamic())
64956488
return true;
64966489

6497-
// FIXME: Remove this once getInterfaceType(), isDesignatedInit() and
6498-
// anything else that is used below has been request-ified.
6499-
if (!base->hasInterfaceType()) {
6500-
ctx.getLazyResolver()->resolveDeclSignature(
6501-
const_cast<AbstractFunctionDecl *>(base));
6502-
}
6503-
65046490
// As above, convenience initializers are not formally overridable in Swift
65056491
// vtables, although same-named initializers are modeled as overriding for
65066492
// various QoI and objc interop reasons. Even if we "override" a non-required
@@ -6517,6 +6503,17 @@ static bool requiresNewVTableEntry(const AbstractFunctionDecl *decl) {
65176503
if (decl->isEffectiveLinkageMoreVisibleThan(base))
65186504
return true;
65196505

6506+
// FIXME: Remove this once getInterfaceType() has been request-ified.
6507+
if (!decl->hasInterfaceType()) {
6508+
ctx.getLazyResolver()->resolveDeclSignature(
6509+
const_cast<AbstractFunctionDecl *>(decl));
6510+
}
6511+
6512+
if (!base->hasInterfaceType()) {
6513+
ctx.getLazyResolver()->resolveDeclSignature(
6514+
const_cast<AbstractFunctionDecl *>(base));
6515+
}
6516+
65206517
// If the method overrides something, we only need a new entry if the
65216518
// override has a more general AST type. However an abstraction
65226519
// change is OK; we don't want to add a whole new vtable entry just

0 commit comments

Comments
 (0)