Skip to content

Commit 5a49a33

Browse files
committed
RequirementMachine: Fix some comments
1 parent 7eeb563 commit 5a49a33

File tree

2 files changed

+14
-4
lines changed

2 files changed

+14
-4
lines changed

lib/AST/RequirementMachine/MinimalConformances.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -447,6 +447,17 @@ void RewriteSystem::computeCandidateConformancePaths(
447447
continue;
448448
}
449449

450+
// A concrete conformance rule (T.[concrete: C : P] => T) implies
451+
// the existence of a conformance rule (V.[P] => V) where T == U.V.
452+
//
453+
// Record an equation allowing the concrete conformance to be
454+
// expressed in terms of the abstract conformance:
455+
//
456+
// (T.[concrete: C : P]) := (U.[domain(V)])(V.[P])
457+
//
458+
// and also vice versa in the case |V| == 0:
459+
//
460+
// (T.[P]) := (T.[concrete: C : P])
450461
if (lhs.isAnyConformanceRule() &&
451462
lhs.getLHS().back().getKind() == Symbol::Kind::ConcreteConformance) {
452463
MutableTerm t(lhs.getLHS().begin(), lhs.getLHS().end() - 1);

lib/AST/RequirementMachine/RewriteLoop.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -514,16 +514,15 @@ unsigned RewriteLoop::getDecomposeCount(
514514
return DecomposeCount;
515515
}
516516

517-
/// Returns true if the loop contains at least one concrete protocol typealias rule,
518-
/// which have the form ([P].A.[concrete: C] => [P].A).
517+
/// Returns true if the loop contains at least one concrete protocol typealias rule.
518+
/// See Rule::isDerivedFromConcreteProtocolTypeAliasRule().
519519
bool RewriteLoop::hasConcreteTypeAliasRule(
520520
const RewriteSystem &system) const {
521521
const_cast<RewriteLoop *>(this)->recompute(system);
522522
return HasConcreteTypeAliasRule;
523523
}
524524

525-
/// The number of Decompose steps, used by the elimination order to prioritize
526-
/// loops that are not concrete simplifications.
525+
/// Returns true if the loop contains any rules in empty context.
527526
bool RewriteLoop::isUseful(
528527
const RewriteSystem &system) const {
529528
const_cast<RewriteLoop *>(this)->recompute(system);

0 commit comments

Comments
 (0)