@@ -312,14 +312,6 @@ VarDecl *DebugValueAddrInst::getDecl() const {
312
312
return getLoc ().getAsASTNode <VarDecl>();
313
313
}
314
314
315
- static void declareWitnessTable (SILModule &Mod,
316
- ProtocolConformanceRef conformanceRef) {
317
- if (conformanceRef.isAbstract ()) return ;
318
- auto C = conformanceRef.getConcrete ();
319
- if (!Mod.lookUpWitnessTable (C, false ))
320
- Mod.createWitnessTableDeclaration (C);
321
- }
322
-
323
315
AllocExistentialBoxInst *AllocExistentialBoxInst::create (
324
316
SILDebugLocation Loc, SILType ExistentialType, CanType ConcreteType,
325
317
ArrayRef<ProtocolConformanceRef> Conformances,
@@ -331,8 +323,6 @@ AllocExistentialBoxInst *AllocExistentialBoxInst::create(
331
323
SILModule &Mod = F->getModule ();
332
324
auto Size = totalSizeToAlloc<swift::Operand>(TypeDependentOperands.size ());
333
325
auto Buffer = Mod.allocateInst (Size, alignof (AllocExistentialBoxInst));
334
- for (ProtocolConformanceRef C : Conformances)
335
- declareWitnessTable (Mod, C);
336
326
return ::new (Buffer) AllocExistentialBoxInst (Loc,
337
327
ExistentialType,
338
328
ConcreteType,
@@ -1631,7 +1621,6 @@ WitnessMethodInst::create(SILDebugLocation Loc, CanType LookupType,
1631
1621
auto Size = totalSizeToAlloc<swift::Operand>(TypeDependentOperands.size ());
1632
1622
auto Buffer = Mod.allocateInst (Size, alignof (WitnessMethodInst));
1633
1623
1634
- declareWitnessTable (Mod, Conformance);
1635
1624
return ::new (Buffer) WitnessMethodInst (Loc, LookupType, Conformance, Member,
1636
1625
Ty, TypeDependentOperands);
1637
1626
}
@@ -1665,8 +1654,6 @@ InitExistentialAddrInst *InitExistentialAddrInst::create(
1665
1654
totalSizeToAlloc<swift::Operand>(1 + TypeDependentOperands.size ());
1666
1655
void *Buffer = Mod.allocateInst (size,
1667
1656
alignof (InitExistentialAddrInst));
1668
- for (ProtocolConformanceRef C : Conformances)
1669
- declareWitnessTable (Mod, C);
1670
1657
return ::new (Buffer) InitExistentialAddrInst (Loc, Existential,
1671
1658
TypeDependentOperands,
1672
1659
ConcreteType,
@@ -1686,9 +1673,6 @@ InitExistentialValueInst *InitExistentialValueInst::create(
1686
1673
totalSizeToAlloc<swift::Operand>(1 + TypeDependentOperands.size ());
1687
1674
1688
1675
void *Buffer = Mod.allocateInst (size, alignof (InitExistentialRefInst));
1689
- for (ProtocolConformanceRef C : Conformances)
1690
- declareWitnessTable (Mod, C);
1691
-
1692
1676
return ::new (Buffer)
1693
1677
InitExistentialValueInst (Loc, ExistentialType, ConcreteType, Instance,
1694
1678
TypeDependentOperands, Conformances);
@@ -1709,9 +1693,6 @@ InitExistentialRefInst::create(SILDebugLocation Loc, SILType ExistentialType,
1709
1693
1710
1694
void *Buffer = Mod.allocateInst (size,
1711
1695
alignof (InitExistentialRefInst));
1712
- for (ProtocolConformanceRef C : Conformances)
1713
- declareWitnessTable (Mod, C);
1714
-
1715
1696
return ::new (Buffer) InitExistentialRefInst (Loc, ExistentialType,
1716
1697
ConcreteType,
1717
1698
Instance,
@@ -1744,9 +1725,6 @@ InitExistentialMetatypeInst *InitExistentialMetatypeInst::create(
1744
1725
1 + TypeDependentOperands.size (), conformances.size ());
1745
1726
1746
1727
void *buffer = M.allocateInst (size, alignof (InitExistentialMetatypeInst));
1747
- for (ProtocolConformanceRef conformance : conformances)
1748
- declareWitnessTable (M, conformance);
1749
-
1750
1728
return ::new (buffer) InitExistentialMetatypeInst (
1751
1729
Loc, existentialMetatypeType, metatype,
1752
1730
TypeDependentOperands, conformances);
0 commit comments