@@ -477,56 +477,6 @@ bool SILType::isHeapObjectReferenceType() const {
477
477
return false ;
478
478
}
479
479
480
- bool SILType::aggregateContainsRecord (SILType Record, SILModule &Mod,
481
- TypeExpansionContext context) const {
482
- assert (!hasArchetype () && " Agg should be proven to not be generic "
483
- " before passed to this function." );
484
- assert (!Record.hasArchetype () && " Record should be proven to not be generic "
485
- " before passed to this function." );
486
-
487
- llvm::SmallVector<SILType, 8 > Worklist;
488
- Worklist.push_back (*this );
489
-
490
- // For each "subrecord" of agg in the worklist...
491
- while (!Worklist.empty ()) {
492
- SILType Ty = Worklist.pop_back_val ();
493
-
494
- // If it is record, we succeeded. Return true.
495
- if (Ty == Record)
496
- return true ;
497
-
498
- // Otherwise, we gather up sub-records that need to be checked for
499
- // checking... First handle the tuple case.
500
- if (CanTupleType TT = Ty.getAs <TupleType>()) {
501
- for (unsigned i = 0 , e = TT->getNumElements (); i != e; ++i)
502
- Worklist.push_back (Ty.getTupleElementType (i));
503
- continue ;
504
- }
505
-
506
- // Then if we have an enum...
507
- if (EnumDecl *E = Ty.getEnumOrBoundGenericEnum ()) {
508
- for (auto Elt : E->getAllElements ())
509
- if (Elt->hasAssociatedValues ())
510
- Worklist.push_back (Ty.getEnumElementType (Elt, Mod, context));
511
- continue ;
512
- }
513
-
514
- // Then if we have a struct address...
515
- if (StructDecl *S = Ty.getStructOrBoundGenericStruct ())
516
- for (VarDecl *Var : S->getStoredProperties ())
517
- Worklist.push_back (Ty.getFieldType (Var, Mod, context));
518
-
519
- // If we have a class address, it is a pointer so it cannot contain other
520
- // types.
521
-
522
- // If we reached this point, then this type has no subrecords. Since it does
523
- // not equal our record, we can skip it.
524
- }
525
-
526
- // Could not find the record in the aggregate.
527
- return false ;
528
- }
529
-
530
480
bool SILType::aggregateHasUnreferenceableStorage () const {
531
481
if (auto s = getStructOrBoundGenericStruct ()) {
532
482
return s->hasUnreferenceableStorage ();
0 commit comments