@@ -599,20 +599,7 @@ ProjectionPath::expandTypeIntoLeafProjectionPaths(SILType B, SILModule *Mod,
599
599
600
600
LLVM_DEBUG (llvm::dbgs () << " Visiting type: " << Ty << " \n " );
601
601
602
- // Get the first level projection of the current type.
603
- Projections.clear ();
604
- Projection::getFirstLevelProjections (Ty, *Mod, Projections);
605
-
606
- // Reached the end of the projection tree, this field can not be expanded
607
- // anymore.
608
- if (Projections.empty ()) {
609
- LLVM_DEBUG (llvm::dbgs () << " No projections. "
610
- " Finished projection list\n " );
611
- Paths.push_back (PP);
612
- continue ;
613
- }
614
-
615
- // If this is a class type, we also have reached the end of the type
602
+ // If this is a class type, we have reached the end of the type
616
603
// tree for this type.
617
604
//
618
605
// We do not push its next level projection into the worklist,
@@ -635,6 +622,19 @@ ProjectionPath::expandTypeIntoLeafProjectionPaths(SILType B, SILModule *Mod,
635
622
continue ;
636
623
}
637
624
625
+ // Get the first level projection of the current type.
626
+ Projections.clear ();
627
+ Projection::getFirstLevelProjections (Ty, *Mod, Projections);
628
+
629
+ // Reached the end of the projection tree, this field can not be expanded
630
+ // anymore.
631
+ if (Projections.empty ()) {
632
+ LLVM_DEBUG (llvm::dbgs () << " No projections. "
633
+ " Finished projection list\n " );
634
+ Paths.push_back (PP);
635
+ continue ;
636
+ }
637
+
638
638
// Keep expanding the location.
639
639
for (auto &P : Projections) {
640
640
ProjectionPath X (B);
0 commit comments