RequirementMachine: Tighten up createRequirementFromRule()

Now that the 'identity conformance' [P].[P] => [P] is permanent,
we won't see it here, so we can just assume that any non-permanent,
non-redundant rule maps to a requirement.
This commit is contained in:
Slava Pestov
2021-10-22 23:57:43 -04:00
parent a8bc8a86fb
commit f44926b6b9

View File

@@ -154,12 +154,13 @@ RequirementMachine::buildRequirementSignature(ArrayRef<unsigned> rules,
}
llvm_unreachable("Invalid symbol kind");
} else if (rule.getLHS().back().getKind() != Symbol::Kind::Protocol) {
auto constraintType = Context.getTypeForTerm(rule.getLHS(), genericParams);
auto subjectType = Context.getTypeForTerm(rule.getRHS(), genericParams);
sameTypeReqs[subjectType.getPointer()].Members.push_back(constraintType);
}
assert(rule.getLHS().back().getKind() != Symbol::Kind::Protocol);
auto constraintType = Context.getTypeForTerm(rule.getLHS(), genericParams);
auto subjectType = Context.getTypeForTerm(rule.getRHS(), genericParams);
sameTypeReqs[subjectType.getPointer()].Members.push_back(constraintType);
};
if (getDebugOptions().contains(DebugFlags::Minimization)) {