mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[SIL] Don’t create witness table entries for overriding requirements.
SIL will not generate calls to protocol requirements that override other protocol requirements, so all of the witness table entries for the overriding arguments are dynamically dead. Remove them from the witness tables entirely. Implements rdar://problem/43870489, reducing the size of the standard library binary by 196k.
This commit is contained in:
@@ -721,7 +721,11 @@ bool SILDeclRef::requiresNewVTableEntry() const {
|
||||
}
|
||||
|
||||
bool SILDeclRef::requiresNewWitnessTableEntry() const {
|
||||
return cast<AbstractFunctionDecl>(getDecl())->getOverriddenDecls().empty();
|
||||
return requiresNewWitnessTableEntry(cast<AbstractFunctionDecl>(getDecl()));
|
||||
}
|
||||
|
||||
bool SILDeclRef::requiresNewWitnessTableEntry(AbstractFunctionDecl *func) {
|
||||
return func->getOverriddenDecls().empty();
|
||||
}
|
||||
|
||||
SILDeclRef SILDeclRef::getOverridden() const {
|
||||
|
||||
Reference in New Issue
Block a user