mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
SILGen: Add linkage to SILDefaultWitnessTable
This is only used in the verifier, to ensure that default witness thunks are suffiently visible. Also this patch removes the asserts enforcing that only resilient protocols have a default witness table. This will change in an upcoming patch, and in this patch is necessary for the test to work.
This commit is contained in:
@@ -190,23 +190,17 @@ SILModule::lookUpDefaultWitnessTable(const ProtocolDecl *Protocol) {
|
||||
|
||||
auto found = DefaultWitnessTableMap.find(Protocol);
|
||||
if (found == DefaultWitnessTableMap.end()) {
|
||||
assert(Protocol->hasFixedLayout() &&
|
||||
"Resilient protocol must have a default witness table");
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
assert(!Protocol->hasFixedLayout() &&
|
||||
"Fixed-layout protocol cannot have a default witness table");
|
||||
|
||||
return found->second;
|
||||
}
|
||||
|
||||
SILDefaultWitnessTable *
|
||||
SILModule::createDefaultWitnessTableDeclaration(const ProtocolDecl *Protocol) {
|
||||
assert(!Protocol->hasFixedLayout() &&
|
||||
"Fixed-layout protocol cannot have a default witness table");
|
||||
|
||||
return SILDefaultWitnessTable::create(*this, Protocol);
|
||||
SILModule::createDefaultWitnessTableDeclaration(const ProtocolDecl *Protocol,
|
||||
SILLinkage Linkage) {
|
||||
return SILDefaultWitnessTable::create(*this, Linkage, Protocol);
|
||||
}
|
||||
|
||||
SILFunction *SILModule::getOrCreateFunction(SILLocation loc,
|
||||
|
||||
Reference in New Issue
Block a user