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:
Slava Pestov
2018-12-20 15:17:34 -05:00
parent ff47c303ad
commit 39c93b9f85
4 changed files with 7 additions and 11 deletions

View File

@@ -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 *