@@ -63,15 +63,21 @@ class RequirementSource {
63
63
// / The requirement was explicitly stated in the generic parameter
64
64
// / clause.
65
65
Explicit,
66
- // / The requirement was explicitly stated in the generic parameter clause
67
- // / but is redundant with some other requirement.
68
- Redundant,
69
- // / The requirement was part of a protocol requirement, e.g., an
70
- // / inherited protocol or a requirement on an associated type.
71
- Protocol,
72
- // /
73
- // / The requirement was inferred from part of the signature.
66
+ // / The requirement was inferred from the function's parameter or
67
+ // / result types.
74
68
Inferred,
69
+
70
+ // / The requirement was part of a protocol requirement on an
71
+ // / associated type.
72
+ // /
73
+ // / These are dropped when building the GenericSignature.
74
+ Protocol,
75
+
76
+ // / The requirement is redundant with some other requirement.
77
+ // /
78
+ // / These are dropped when building the GenericSignature.
79
+ Redundant,
80
+
75
81
// / The requirement came from an outer scope.
76
82
// / FIXME: eliminate this in favor of keeping requirement sources in
77
83
// / GenericSignatures, at least non-canonical ones?
@@ -242,9 +248,10 @@ class ArchetypeBuilder {
242
248
// / \brief Add all of a generic signature's parameters and requirements.
243
249
// /
244
250
// / FIXME: Requirements from the generic signature are treated as coming from
245
- // / an outer scope in order to avoid disturbing the AllDependentTypes.
246
- // / Setting \c treatRequirementsAsExplicit to true disables this behavior.
247
- void addGenericSignature (GenericSignature *sig, bool adoptArchetypes,
251
+ // / an outer scope. Setting \c treatRequirementsAsExplicit to true disables
252
+ // / this behavior.
253
+ void addGenericSignature (GenericSignature *sig,
254
+ GenericEnvironment *genericEnv,
248
255
bool treatRequirementsAsExplicit = false );
249
256
250
257
// / \brief Get a generic signature based on the provided complete list
@@ -342,13 +349,6 @@ class ArchetypeBuilder {
342
349
using SameTypeRequirement
343
350
= std::pair<PotentialArchetype *,
344
351
PointerUnion<Type, PotentialArchetype*>>;
345
-
346
- // / Retrieve the set of same-type requirements that apply to the potential
347
- // / archetypes known to this builder.
348
- ArrayRef<SameTypeRequirement> getSameTypeRequirements () const ;
349
-
350
- // FIXME: Compute the set of 'extra' witness tables needed to express this
351
- // requirement set.
352
352
353
353
// / \brief Dump all of the requirements, both specified and inferred.
354
354
LLVM_ATTRIBUTE_DEPRECATED (
@@ -617,15 +617,15 @@ class ArchetypeBuilder::PotentialArchetype {
617
617
}
618
618
619
619
void setIsRecursive () { IsRecursive = true ; }
620
- bool isRecursive () { return IsRecursive; }
620
+ bool isRecursive () const { return IsRecursive; }
621
621
622
- bool isInvalid () { return Invalid; }
622
+ bool isInvalid () const { return Invalid; }
623
623
624
624
void setInvalid () { Invalid = true ; }
625
625
626
626
// / Determine whether this archetype was renamed due to typo
627
627
// / correction. If so, \c getName() retrieves the new name.
628
- bool wasRenamed () { return Renamed; }
628
+ bool wasRenamed () const { return Renamed; }
629
629
630
630
// / Note that this potential archetype was renamed (due to typo
631
631
// / correction), providing the new name.
@@ -636,7 +636,7 @@ class ArchetypeBuilder::PotentialArchetype {
636
636
637
637
// / Whether this potential archetype makes a better archetype anchor than
638
638
// / the given archetype anchor.
639
- bool isBetterArchetypeAnchor (PotentialArchetype *other);
639
+ bool isBetterArchetypeAnchor (PotentialArchetype *other) const ;
640
640
641
641
void dump (llvm::raw_ostream &Out, SourceManager *SrcMgr,
642
642
unsigned Indent);
0 commit comments