Skip to content

Commit 91b6bda

Browse files
committed
[IRGen] Distributed: Don't attempt to inject protocols without witness tables
1 parent e85bd1f commit 91b6bda

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

lib/IRGen/GenProto.cpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -766,14 +766,17 @@ void EmitPolymorphicParameters::injectAdHocDistributedRequirements() {
766766
if (!genericParam)
767767
return;
768768

769-
auto requirements = sig->getLocalRequirements(genericParam);
770-
if (requirements.protos.empty())
769+
auto protocols = sig->getRequiredProtocols(genericParam);
770+
if (protocols.empty())
771771
return;
772772

773773
auto archetypeTy = getTypeInContext(genericParam->getCanonicalType());
774774
llvm::Value *metadata = IGF.emitTypeMetadataRef(archetypeTy);
775775

776-
for (auto *proto : requirements.protos) {
776+
for (auto *proto : protocols) {
777+
if (!Lowering::TypeConverter::protocolRequiresWitnessTable(proto))
778+
continue;
779+
777780
// Lookup the witness table for this protocol dynamically via
778781
// swift_conformsToProtocol(<<archetype>>, <<protocol>>)
779782
auto *witnessTable = IGF.Builder.CreateCall(

0 commit comments

Comments
 (0)