mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[IRGen] Implement resilient access pattern for associated conformances.
When referencing an associated conformance in a witness table for a resilient protocol, use the associated conformance descriptor to compute the index into the witness table at run-time. Another part of rdar://problem/44167982.
This commit is contained in:
@@ -3387,6 +3387,16 @@ llvm::GlobalValue *IRGenModule::defineAssociatedTypeDescriptor(
|
||||
return defineAlias(entity, definition);
|
||||
}
|
||||
|
||||
llvm::Constant *IRGenModule::getAddrOfAssociatedConformanceDescriptor(
|
||||
AssociatedConformance conformance) {
|
||||
auto entity = LinkEntity::forAssociatedConformanceDescriptor(
|
||||
conformance.getSourceProtocol(),
|
||||
conformance.getAssociation(),
|
||||
conformance.getAssociatedRequirement());
|
||||
return getAddrOfLLVMVariable(entity, getPointerAlignment(), ConstantInit(),
|
||||
ProtocolRequirementStructTy, DebugTypeInfo());
|
||||
}
|
||||
|
||||
llvm::GlobalValue *IRGenModule::defineAssociatedConformanceDescriptor(
|
||||
ProtocolDecl *proto,
|
||||
CanType subject,
|
||||
|
||||
Reference in New Issue
Block a user