Skip to content

Commit cecbae2

Browse files
committed
[Distributed] IRGen: Remove a decodeNextArgument access workaround
The symbol is always retained now, so the workaround to use witness table for non-final classes is no longer necessary.
1 parent fc20e1e commit cecbae2

File tree

1 file changed

+6
-15
lines changed

1 file changed

+6
-15
lines changed

lib/IRGen/GenDistributed.cpp

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -813,22 +813,13 @@ ArgumentDecoderInfo DistributedAccessor::findArgumentDecoder(
813813
decoder = instance.claimNext();
814814
}
815815

816-
// TODO(distributed): this can be removed most likely now
817-
if (isa<StructDecl>(decoderDecl) || isa<EnumDecl>(decoderDecl) ||
818-
decoderDecl->isFinal()) {
819-
auto *decodeSIL = IGM.getSILModule().lookUpFunction(SILDeclRef(decodeFn));
820-
auto *fnPtr = IGM.getAddrOfSILFunction(decodeSIL, NotForDefinition,
821-
/*isDynamicallyReplacible=*/false);
822-
823-
auto methodPtr = FunctionPointer::forDirect(
824-
classifyFunctionPointerKind(decodeSIL), fnPtr,
825-
/*secondaryValue=*/nullptr, signature);
826-
827-
return {decoder, decoderTy, witnessTable, methodPtr, methodTy};
828-
}
816+
auto *decodeSIL = IGM.getSILModule().lookUpFunction(SILDeclRef(decodeFn));
817+
auto *fnPtr = IGM.getAddrOfSILFunction(decodeSIL, NotForDefinition,
818+
/*isDynamicallyReplacible=*/false);
829819

830-
auto methodPtr =
831-
emitVirtualMethodValue(IGF, decoderTy, SILDeclRef(decodeFn), methodTy);
820+
auto methodPtr = FunctionPointer::forDirect(
821+
classifyFunctionPointerKind(decodeSIL), fnPtr,
822+
/*secondaryValue=*/nullptr, signature);
832823

833824
return {decoder, decoderTy, witnessTable, methodPtr, methodTy};
834825
}

0 commit comments

Comments
 (0)