@@ -56,7 +56,6 @@ static void recordRelation(Term key,
5656 unsigned lhsRuleID,
5757 Symbol rhsProperty,
5858 RewriteSystem &system,
59- SmallVectorImpl<InducedRule> &inducedRules,
6059 bool debug) {
6160 const auto &lhsRule = system.getRule (lhsRuleID);
6261 auto lhsProperty = lhsRule.getLHS ().back ();
@@ -141,19 +140,17 @@ namespace {
141140 ArrayRef<Term> rhsSubstitutions;
142141 RewriteContext &ctx;
143142 RewriteSystem &system;
144- SmallVectorImpl<InducedRule> &inducedRules;
145143 bool debug;
146144
147145 public:
148146 ConcreteTypeMatcher (ArrayRef<Term> lhsSubstitutions,
149147 ArrayRef<Term> rhsSubstitutions,
150148 RewriteSystem &system,
151- SmallVectorImpl<InducedRule> &inducedRules,
152149 bool debug)
153150 : lhsSubstitutions(lhsSubstitutions),
154151 rhsSubstitutions (rhsSubstitutions),
155152 ctx(system.getRewriteContext()), system(system),
156- inducedRules(inducedRules), debug(debug) {}
153+ debug(debug) {}
157154
158155 bool alwaysMismatchTypeParameters () const { return true ; }
159156
@@ -260,7 +257,6 @@ namespace {
260257// / Returns true if a conflict was detected.
261258static bool unifyConcreteTypes (
262259 Symbol lhs, Symbol rhs, RewriteSystem &system,
263- SmallVectorImpl<InducedRule> &inducedRules,
264260 bool debug) {
265261 auto lhsType = lhs.getConcreteType ();
266262 auto rhsType = rhs.getConcreteType ();
@@ -271,7 +267,7 @@ static bool unifyConcreteTypes(
271267
272268 ConcreteTypeMatcher matcher (lhs.getSubstitutions (),
273269 rhs.getSubstitutions (),
274- system, inducedRules, debug);
270+ system, debug);
275271 if (!matcher.match (lhsType, rhsType)) {
276272 // FIXME: Diagnose the conflict
277273 if (debug) {
@@ -308,7 +304,6 @@ static bool unifyConcreteTypes(
308304// / that gets recorded in the property map.
309305static std::pair<Symbol, bool > unifySuperclasses (
310306 Symbol lhs, Symbol rhs, RewriteSystem &system,
311- SmallVectorImpl<InducedRule> &inducedRules,
312307 bool debug) {
313308 if (debug) {
314309 llvm::dbgs () << " % Unifying " << lhs << " with " << rhs << " \n " ;
@@ -351,7 +346,7 @@ static std::pair<Symbol, bool> unifySuperclasses(
351346 // Unify type contructor arguments.
352347 ConcreteTypeMatcher matcher (lhs.getSubstitutions (),
353348 rhs.getSubstitutions (),
354- system, inducedRules, debug);
349+ system, debug);
355350 if (!matcher.match (lhsType, rhsType)) {
356351 if (debug) {
357352 llvm::dbgs () << " %% Superclass conflict\n " ;
@@ -366,8 +361,7 @@ static std::pair<Symbol, bool> unifySuperclasses(
366361// / Record a protocol conformance, layout or superclass constraint on the given
367362// / key. Must be called in monotonically non-decreasing key order.
368363void PropertyMap::addProperty (
369- Term key, Symbol property, unsigned ruleID,
370- SmallVectorImpl<InducedRule> &inducedRules) {
364+ Term key, Symbol property, unsigned ruleID) {
371365 assert (property.isProperty ());
372366 assert (*System.getRule (ruleID).isPropertyRule () == property);
373367 auto *props = getOrCreateProperties (key);
@@ -401,17 +395,15 @@ void PropertyMap::addProperty(
401395 // the new layout requirement is redundant.
402396 if (mergedLayout == props->Layout ) {
403397 if (checkRulePairOnce (*props->LayoutRule , ruleID)) {
404- recordRelation (key, *props->LayoutRule , property, System,
405- inducedRules, debug);
398+ recordRelation (key, *props->LayoutRule , property, System, debug);
406399 }
407400
408401 // If the intersection is equal to the new layout requirement, the
409402 // existing layout requirement is redundant.
410403 } else if (mergedLayout == newLayout) {
411404 if (checkRulePairOnce (ruleID, *props->LayoutRule )) {
412405 auto oldProperty = System.getRule (*props->LayoutRule ).getLHS ().back ();
413- recordRelation (key, ruleID, oldProperty, System,
414- inducedRules, debug);
406+ recordRelation (key, ruleID, oldProperty, System, debug);
415407 }
416408
417409 props->LayoutRule = ruleID;
@@ -437,8 +429,7 @@ void PropertyMap::addProperty(
437429 Context.getASTContext ());
438430 auto layoutSymbol = Symbol::forLayout (layout, Context);
439431
440- recordRelation (key, ruleID, layoutSymbol, System,
441- inducedRules, debug);
432+ recordRelation (key, ruleID, layoutSymbol, System, debug);
442433 }
443434
444435 if (!props->Superclass ) {
@@ -447,7 +438,7 @@ void PropertyMap::addProperty(
447438 } else {
448439 assert (props->SuperclassRule .hasValue ());
449440 auto pair = unifySuperclasses (*props->Superclass , property,
450- System, inducedRules, debug);
441+ System, debug);
451442 props->Superclass = pair.first ;
452443 bool conflict = pair.second ;
453444 if (conflict) {
@@ -466,7 +457,7 @@ void PropertyMap::addProperty(
466457 } else {
467458 assert (props->ConcreteTypeRule .hasValue ());
468459 bool conflict = unifyConcreteTypes (*props->ConcreteType , property,
469- System, inducedRules, debug);
460+ System, debug);
470461 if (conflict) {
471462 recordConflict (key, *props->ConcreteTypeRule , ruleID, System);
472463 return ;
@@ -489,8 +480,7 @@ void PropertyMap::addProperty(
489480 llvm_unreachable (" Bad symbol kind" );
490481}
491482
492- void PropertyMap::checkConcreteTypeRequirements (
493- SmallVectorImpl<InducedRule> &inducedRules) {
483+ void PropertyMap::checkConcreteTypeRequirements () {
494484 bool debug = Debug.contains (DebugFlags::ConcreteUnification);
495485
496486 for (auto *props : Entries) {
@@ -505,8 +495,7 @@ void PropertyMap::checkConcreteTypeRequirements(
505495 Context);
506496
507497 recordRelation (props->getKey (), *props->ConcreteTypeRule ,
508- superclassSymbol, System,
509- inducedRules, debug);
498+ superclassSymbol, System, debug);
510499
511500 // Otherwise, we have a concrete vs superclass conflict.
512501 } else {
@@ -518,8 +507,7 @@ void PropertyMap::checkConcreteTypeRequirements(
518507 }
519508}
520509
521- void PropertyMap::concretizeNestedTypesFromConcreteParents (
522- SmallVectorImpl<InducedRule> &inducedRules) {
510+ void PropertyMap::concretizeNestedTypesFromConcreteParents () {
523511 for (auto *props : Entries) {
524512 if (props->getConformsTo ().empty ())
525513 continue ;
@@ -546,8 +534,7 @@ void PropertyMap::concretizeNestedTypesFromConcreteParents(
546534 props->ConcreteType ->getSubstitutions (),
547535 props->ConformsToRules ,
548536 props->ConformsTo ,
549- props->ConcreteConformances ,
550- inducedRules);
537+ props->ConcreteConformances );
551538 }
552539
553540 if (props->hasSuperclassBound ()) {
@@ -563,8 +550,7 @@ void PropertyMap::concretizeNestedTypesFromConcreteParents(
563550 props->Superclass ->getSubstitutions (),
564551 props->ConformsToRules ,
565552 props->ConformsTo ,
566- props->SuperclassConformances ,
567- inducedRules);
553+ props->SuperclassConformances );
568554 }
569555 }
570556}
@@ -608,8 +594,7 @@ void PropertyMap::concretizeNestedTypesFromConcreteParent(
608594 ArrayRef<Term> substitutions,
609595 ArrayRef<unsigned > conformsToRules,
610596 ArrayRef<const ProtocolDecl *> conformsTo,
611- llvm::TinyPtrVector<ProtocolConformance *> &conformances,
612- SmallVectorImpl<InducedRule> &inducedRules) {
597+ llvm::TinyPtrVector<ProtocolConformance *> &conformances) {
613598 assert (requirementKind == RequirementKind::SameType ||
614599 requirementKind == RequirementKind::Superclass);
615600 assert (conformsTo.size () == conformsToRules.size ());
@@ -684,8 +669,7 @@ void PropertyMap::concretizeNestedTypesFromConcreteParent(
684669 concreteType, substitutions, proto, Context);
685670
686671 recordConcreteConformanceRule (concreteRuleID, conformanceRuleID,
687- requirementKind, concreteConformanceSymbol,
688- inducedRules);
672+ requirementKind, concreteConformanceSymbol);
689673
690674 auto assocTypes = proto->getAssociatedTypeMembers ();
691675 if (assocTypes.empty ())
@@ -694,8 +678,7 @@ void PropertyMap::concretizeNestedTypesFromConcreteParent(
694678 for (auto *assocType : assocTypes) {
695679 concretizeTypeWitnessInConformance (key, requirementKind,
696680 concreteConformanceSymbol,
697- concrete, assocType,
698- inducedRules);
681+ concrete, assocType);
699682 }
700683 }
701684}
@@ -704,8 +687,7 @@ void PropertyMap::concretizeTypeWitnessInConformance(
704687 Term key, RequirementKind requirementKind,
705688 Symbol concreteConformanceSymbol,
706689 ProtocolConformance *concrete,
707- AssociatedTypeDecl *assocType,
708- SmallVectorImpl<InducedRule> &inducedRules) const {
690+ AssociatedTypeDecl *assocType) const {
709691 auto concreteType = concreteConformanceSymbol.getConcreteType ();
710692 auto substitutions = concreteConformanceSymbol.getSubstitutions ();
711693 auto *proto = concreteConformanceSymbol.getProtocol ();
@@ -926,8 +908,7 @@ void PropertyMap::recordConcreteConformanceRule(
926908 unsigned concreteRuleID,
927909 unsigned conformanceRuleID,
928910 RequirementKind requirementKind,
929- Symbol concreteConformanceSymbol,
930- SmallVectorImpl<InducedRule> &inducedRules) const {
911+ Symbol concreteConformanceSymbol) const {
931912 const auto &concreteRule = System.getRule (concreteRuleID);
932913 const auto &conformanceRule = System.getRule (conformanceRuleID);
933914
0 commit comments