[sil-devirtualizer] Rename isClassWithUnboundGenericParameters and extend it to work with any nominal types

This commit is contained in:
Roman Levenstein
2015-12-13 18:34:32 -08:00
parent d6bb64a84c
commit cbcd008ac4
3 changed files with 7 additions and 7 deletions

View File

@@ -102,11 +102,11 @@ static CanType bindSuperclass(CanType Superclass,
// Returns true if any generic types parameters of the class are
// unbound.
bool swift::isClassWithUnboundGenericParameters(SILType C, SILModule &M) {
auto *CD = C.getClassOrBoundGenericClass();
if (CD && CD->getGenericSignature()) {
bool swift::isNominalTypeWithUnboundGenericParameters(SILType Ty, SILModule &M) {
auto *ND = Ty.getNominalOrBoundGenericNominal();
if (ND && ND->getGenericSignature()) {
auto InstanceTypeSubsts =
C.gatherAllSubstitutions(M);
Ty.gatherAllSubstitutions(M);
if (!InstanceTypeSubsts.empty()) {
if (hasUnboundGenericTypes(InstanceTypeSubsts))
@@ -114,7 +114,7 @@ bool swift::isClassWithUnboundGenericParameters(SILType C, SILModule &M) {
}
}
if (C.hasArchetype())
if (Ty.hasArchetype())
return true;
return false;