2828// arbitrary type, not just a type parameter, and recursively transfozms the
2929// type parameters it contains, if any.
3030//
31- // Also, getConformanceAccessPath () is another one-off operation.
31+ // Also, getConformancePath () is another one-off operation.
3232//
3333// ===----------------------------------------------------------------------===//
3434
@@ -469,7 +469,7 @@ bool RequirementMachine::isValidTypeParameter(Type type) const {
469469 return (prefix == term);
470470}
471471
472- // / Retrieve the conformance access path used to extract the conformance of
472+ // / Retrieve the conformance path used to extract the conformance of
473473// / interface \c type to the given \c protocol.
474474// /
475475// / \param type The interface type whose conformance access path is to be
@@ -480,10 +480,10 @@ bool RequirementMachine::isValidTypeParameter(Type type) const {
480480// / this generic signature and ends at the conformance that makes \c type
481481// / conform to \c protocol.
482482// /
483- // / \seealso ConformanceAccessPath
484- ConformanceAccessPath
485- RequirementMachine::getConformanceAccessPath (Type type,
486- ProtocolDecl *protocol) {
483+ // / \seealso ConformancePath
484+ ConformancePath
485+ RequirementMachine::getConformancePath (Type type,
486+ ProtocolDecl *protocol) {
487487 assert (type->isTypeParameter ());
488488
489489 auto mutTerm = Context.getMutableTermForType (type->getCanonicalType (),
@@ -505,9 +505,9 @@ RequirementMachine::getConformanceAccessPath(Type type,
505505 auto term = Term::get (mutTerm, Context);
506506
507507 // Check if we've already cached the result before doing anything else.
508- auto found = ConformanceAccessPaths .find (
508+ auto found = ConformancePaths .find (
509509 std::make_pair (term, protocol));
510- if (found != ConformanceAccessPaths .end ()) {
510+ if (found != ConformancePaths .end ()) {
511511 return found->second ;
512512 }
513513
@@ -516,25 +516,25 @@ RequirementMachine::getConformanceAccessPath(Type type,
516516 FrontendStatsTracer tracer (Stats, " get-conformance-access-path" );
517517
518518 auto recordPath = [&](Term term, ProtocolDecl *proto,
519- ConformanceAccessPath path) {
519+ ConformancePath path) {
520520 // Add the path to the buffer.
521- CurrentConformanceAccessPaths .emplace_back (term, path);
521+ CurrentConformancePaths .emplace_back (term, path);
522522
523523 // Add the path to the map.
524524 auto key = std::make_pair (term, proto);
525- auto inserted = ConformanceAccessPaths .insert (
525+ auto inserted = ConformancePaths .insert (
526526 std::make_pair (key, path));
527527 assert (inserted.second );
528528 (void ) inserted;
529529
530530 if (Stats)
531- ++Stats->getFrontendCounters ().NumConformanceAccessPathsRecorded ;
531+ ++Stats->getFrontendCounters ().NumConformancePathsRecorded ;
532532 };
533533
534534 // If this is the first time we're asked to look up a conformance access path,
535535 // visit all of the root conformance requirements in our generic signature and
536536 // add them to the buffer.
537- if (ConformanceAccessPaths .empty ()) {
537+ if (ConformancePaths .empty ()) {
538538 for (const auto &req : Sig.getRequirements ()) {
539539 // We only care about conformance requirements.
540540 if (req.getKind () != RequirementKind::Conformance)
@@ -543,9 +543,9 @@ RequirementMachine::getConformanceAccessPath(Type type,
543543 auto rootType = CanType (req.getFirstType ());
544544 auto *rootProto = req.getProtocolDecl ();
545545
546- ConformanceAccessPath ::Entry root (rootType, rootProto);
547- ArrayRef<ConformanceAccessPath ::Entry> path (root);
548- ConformanceAccessPath result (ctx.AllocateCopy (path));
546+ ConformancePath ::Entry root (rootType, rootProto);
547+ ArrayRef<ConformancePath ::Entry> path (root);
548+ ConformancePath result (ctx.AllocateCopy (path));
549549
550550 auto mutTerm = Context.getMutableTermForType (rootType, nullptr );
551551 System.simplify (mutTerm);
@@ -555,17 +555,17 @@ RequirementMachine::getConformanceAccessPath(Type type,
555555 }
556556 }
557557
558- // We enumerate conformance access paths in shortlex order until we find the
558+ // We enumerate conformance paths in shortlex order until we find the
559559 // path whose corresponding type reduces to the one we are looking for.
560560 while (true ) {
561- auto found = ConformanceAccessPaths .find (
561+ auto found = ConformancePaths .find (
562562 std::make_pair (term, protocol));
563- if (found != ConformanceAccessPaths .end ()) {
563+ if (found != ConformancePaths .end ()) {
564564 return found->second ;
565565 }
566566
567- if (CurrentConformanceAccessPaths .empty ()) {
568- llvm::errs () << " Failed to find conformance access path for " ;
567+ if (CurrentConformancePaths .empty ()) {
568+ llvm::errs () << " Failed to find conformance path for " ;
569569 llvm::errs () << type << " (" << term << " )" << " : " ;
570570 llvm::errs () << protocol->getName () << " :\n " ;
571571 type.dump (llvm::errs ());
@@ -574,18 +574,18 @@ RequirementMachine::getConformanceAccessPath(Type type,
574574 abort ();
575575 }
576576
577- // The buffer consists of all conformance access paths of length N.
577+ // The buffer consists of all conformance paths of length N.
578578 // Swap it out with an empty buffer, and fill it with all paths of
579579 // length N+1.
580- std::vector<std::pair<Term, ConformanceAccessPath >> oldPaths;
581- std::swap (CurrentConformanceAccessPaths , oldPaths);
580+ std::vector<std::pair<Term, ConformancePath >> oldPaths;
581+ std::swap (CurrentConformancePaths , oldPaths);
582582
583583 for (const auto &pair : oldPaths) {
584584 const auto &lastElt = pair.second .back ();
585585 auto *lastProto = lastElt.second ;
586586
587587 // A copy of the current path, populated as needed.
588- SmallVector<ConformanceAccessPath ::Entry, 4 > entries;
588+ SmallVector<ConformancePath ::Entry, 4 > entries;
589589
590590 auto reqs = lastProto->getRequirementSignature ().getRequirements ();
591591 for (const auto &req : reqs) {
@@ -607,7 +607,7 @@ RequirementMachine::getConformanceAccessPath(Type type,
607607 // don't add it to the buffer. Note that because we iterate over
608608 // conformance access paths in shortlex order, the existing
609609 // conformance access path is shorter than the one we found just now.
610- if (ConformanceAccessPaths .count (
610+ if (ConformancePaths .count (
611611 std::make_pair (nextTerm, nextProto)))
612612 continue ;
613613
@@ -620,7 +620,7 @@ RequirementMachine::getConformanceAccessPath(Type type,
620620
621621 // Add the next entry.
622622 entries.emplace_back (nextSubjectType, nextProto);
623- ConformanceAccessPath result = ctx.AllocateCopy (entries);
623+ ConformancePath result = ctx.AllocateCopy (entries);
624624 entries.pop_back ();
625625
626626 recordPath (nextTerm, nextProto, result);
0 commit comments