mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[SIL] Unify default witness table entries with witness table entries.
SILWitnessTable::Entry already contains a superset of what was supported by SILDefaultWitnessTable::Entry, the latter of which only had “no entry” and “method” states. Make SILDefaultWitnessTable::Entry an alias for SILWitnessTable::Entry, and unify all of the parsing/printing/ (de)serialization logic.
This commit is contained in:
@@ -535,16 +535,16 @@ SILModule::lookUpFunctionInDefaultWitnessTable(const ProtocolDecl *Protocol,
|
||||
|
||||
// Okay, we found the correct default witness table. Now look for the method.
|
||||
for (auto &Entry : Ret->getEntries()) {
|
||||
// Ignore dummy entries semitted for non-method requirements, as well as
|
||||
// Ignore dummy entries emitted for non-method requirements, as well as
|
||||
// requirements without default implementations.
|
||||
if (!Entry.isValid())
|
||||
if (!Entry.isValid() || Entry.getKind() != SILWitnessTable::Method)
|
||||
continue;
|
||||
|
||||
// Check if this is the member we were looking for.
|
||||
if (Entry.getRequirement() != Requirement)
|
||||
if (Entry.getMethodWitness().Requirement != Requirement)
|
||||
continue;
|
||||
|
||||
return std::make_pair(Entry.getWitness(), Ret);
|
||||
return std::make_pair(Entry.getMethodWitness().Witness, Ret);
|
||||
}
|
||||
|
||||
// This requirement doesn't have a default implementation.
|
||||
|
||||
Reference in New Issue
Block a user