mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
SIL: Remove linkage parameter from SILModule::createWitnessTableDeclaration()
All callers were doing the same thing here, so move it inside the function. Also, change getRootNormalConformance(), which is deprecated, to getRootConformance().
This commit is contained in:
@@ -572,8 +572,7 @@ public:
|
||||
|
||||
// Given a protocol conformance, attempt to create a witness table declaration
|
||||
// for it.
|
||||
SILWitnessTable *
|
||||
createWitnessTableDeclaration(ProtocolConformance *C, SILLinkage linkage);
|
||||
SILWitnessTable *createWitnessTableDeclaration(const ProtocolConformance *C);
|
||||
|
||||
// Given a protocol, attempt to create a default witness table declaration
|
||||
// for it.
|
||||
|
||||
@@ -217,9 +217,7 @@ void SILLinkerVisitor::visitProtocolConformance(
|
||||
// If we don't find any witness table for the conformance, bail and return
|
||||
// false.
|
||||
if (!WT) {
|
||||
Mod.createWitnessTableDeclaration(
|
||||
C, getLinkageForProtocolConformance(
|
||||
C->getRootNormalConformance(), NotForDefinition));
|
||||
Mod.createWitnessTableDeclaration(C);
|
||||
|
||||
// Adding the declaration may allow us to now deserialize the body.
|
||||
// Force the body if we must deserialize this witness table.
|
||||
|
||||
@@ -317,9 +317,7 @@ static void declareWitnessTable(SILModule &Mod,
|
||||
if (conformanceRef.isAbstract()) return;
|
||||
auto C = conformanceRef.getConcrete();
|
||||
if (!Mod.lookUpWitnessTable(C, false))
|
||||
Mod.createWitnessTableDeclaration(C,
|
||||
getLinkageForProtocolConformance(C->getRootNormalConformance(),
|
||||
NotForDefinition));
|
||||
Mod.createWitnessTableDeclaration(C);
|
||||
}
|
||||
|
||||
AllocExistentialBoxInst *AllocExistentialBoxInst::create(
|
||||
|
||||
@@ -144,8 +144,7 @@ void SILModule::deallocateInst(SILInstruction *I) {
|
||||
}
|
||||
|
||||
SILWitnessTable *
|
||||
SILModule::createWitnessTableDeclaration(ProtocolConformance *C,
|
||||
SILLinkage linkage) {
|
||||
SILModule::createWitnessTableDeclaration(const ProtocolConformance *C) {
|
||||
// If we are passed in a null conformance (a valid value), just return nullptr
|
||||
// since we cannot map a witness table to it.
|
||||
if (!C)
|
||||
@@ -153,7 +152,9 @@ SILModule::createWitnessTableDeclaration(ProtocolConformance *C,
|
||||
|
||||
// Extract the root conformance.
|
||||
auto rootC = C->getRootConformance();
|
||||
return SILWitnessTable::create(*this, linkage, rootC);
|
||||
auto linkage = getLinkageForProtocolConformance(rootC, NotForDefinition);
|
||||
return SILWitnessTable::create(*this, linkage,
|
||||
const_cast<RootProtocolConformance *>(rootC));
|
||||
}
|
||||
|
||||
SILWitnessTable *
|
||||
|
||||
Reference in New Issue
Block a user