@@ -360,69 +360,6 @@ class RewriteSystem final {
360
360
Symbol concreteConformanceSymbol,
361
361
Symbol associatedTypeSymbol);
362
362
363
- // / A type witness has a subject type, stored in LHS, which takes the form:
364
- // /
365
- // / T.[concrete: C : P].[P:X]
366
- // /
367
- // / For some concrete type C, protocol P and associated type X.
368
- // /
369
- // / The type witness of X in the conformance C : P is either a concrete type,
370
- // / or an abstract type parameter.
371
- // /
372
- // / If it is a concrete type, then RHS stores the concrete type symbol.
373
- // /
374
- // / If it is an abstract type parameter, then RHS stores the type term.
375
- // /
376
- // / Think of these as rewrite rules which are lazily created, but always
377
- // / "there" -- they encode information about concrete conformances, which
378
- // / are solved outside of the requirement machine itself.
379
- // /
380
- // / We don't want to eagerly pull in all concrete conformances and walk
381
- // / them recursively introducing rewrite rules.
382
- // /
383
- // / The RewriteStep::{Concrete,Same,Abstract}TypeWitness rewrite step kinds
384
- // / reference TypeWitnesses via their RuleID field.
385
- // /
386
- // / Type witnesses are recorded lazily in property map construction, in
387
- // / PropertyMap::computeConstraintTermForTypeWitness().
388
- struct TypeWitness {
389
- Term LHS;
390
- llvm::PointerUnion<Symbol, Term> RHS;
391
-
392
- TypeWitness (Term lhs, llvm::PointerUnion<Symbol, Term> rhs);
393
-
394
- friend bool operator ==(const TypeWitness &lhs,
395
- const TypeWitness &rhs);
396
-
397
- Symbol getConcreteConformance () const {
398
- return *(LHS.end () - 2 );
399
- }
400
-
401
- Symbol getAssocType () const {
402
- return *(LHS.end () - 1 );
403
- }
404
-
405
- Symbol getConcreteType () const {
406
- return RHS.get <Symbol>();
407
- }
408
-
409
- Term getAbstractType () const {
410
- return RHS.get <Term>();
411
- }
412
-
413
- void dump (llvm::raw_ostream &out) const ;
414
- };
415
-
416
- private:
417
- // / Cache for concrete type witnesses. The value in the map is an index
418
- // / into the vector.
419
- llvm::DenseMap<Term, unsigned > TypeWitnessMap;
420
- std::vector<TypeWitness> TypeWitnesses;
421
-
422
- public:
423
- unsigned recordTypeWitness (TypeWitness witness);
424
- const TypeWitness &getTypeWitness (unsigned index) const ;
425
-
426
363
private:
427
364
// ////////////////////////////////////////////////////////////////////////////
428
365
// /
0 commit comments