mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
SIL Linker: Don't link vtables in LinkNormal mode
Mandatory inlining performs devirtualization, which is able to deserialize vtables on its own. And since class methods cannot be @_transparent, we don't have to deserialize any vtable entries unless we're in LinkAll mode, which indicates we're running the performance pipeline.
This commit is contained in:
@@ -344,6 +344,9 @@ bool SILLinkerVisitor::visitInitExistentialRefInst(
|
||||
}
|
||||
|
||||
bool SILLinkerVisitor::visitAllocRefInst(AllocRefInst *ARI) {
|
||||
if (!isLinkAll())
|
||||
return false;
|
||||
|
||||
// Grab the class decl from the alloc ref inst.
|
||||
ClassDecl *D = ARI->getType().getClassOrBoundGenericClass();
|
||||
if (!D)
|
||||
@@ -353,6 +356,9 @@ bool SILLinkerVisitor::visitAllocRefInst(AllocRefInst *ARI) {
|
||||
}
|
||||
|
||||
bool SILLinkerVisitor::visitMetatypeInst(MetatypeInst *MI) {
|
||||
if (!isLinkAll())
|
||||
return false;
|
||||
|
||||
CanType instTy = MI->getType().castTo<MetatypeType>().getInstanceType();
|
||||
ClassDecl *C = instTy.getClassOrBoundGenericClass();
|
||||
if (!C)
|
||||
|
||||
Reference in New Issue
Block a user