Skip to content

Commit db4c28a

Browse files
committed
IRGen: allow specialized witness tables also in regular swift
1 parent 2572885 commit db4c28a

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

lib/IRGen/GenProto.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2485,8 +2485,11 @@ IRGenModule::getConformanceInfo(const ProtocolDecl *protocol,
24852485

24862486
const ConformanceInfo *info;
24872487

2488-
if (Context.LangOpts.hasFeature(Feature::Embedded)) {
2489-
if (auto *sc = dyn_cast<SpecializedProtocolConformance>(conformance)) {
2488+
// If there is a specialized SILWitnessTable for the specialized conformance,
2489+
// directly use it.
2490+
if (auto *sc = dyn_cast<SpecializedProtocolConformance>(conformance)) {
2491+
SILWitnessTable *wt = getSILModule().lookUpWitnessTable(conformance);
2492+
if (wt && wt->getConformance() == sc) {
24902493
info = new SpecializedConformanceInfo(sc);
24912494
Conformances.try_emplace(conformance, info);
24922495
return *info;

0 commit comments

Comments
 (0)