File tree Expand file tree Collapse file tree 2 files changed +9
-4
lines changed Expand file tree Collapse file tree 2 files changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -652,9 +652,14 @@ class IRGenSILFunction :
652
652
StringRef Name,
653
653
unsigned ArgNo = 0 ,
654
654
IndirectionKind Indirection = DirectValue) {
655
- // Eagerly load the type metadata at -Onone.
656
- if (!IGM.Opts .Optimize && SILTy && SILTy.hasArchetype ())
657
- emitTypeMetadataRefForLayout (SILTy);
655
+ // Force all archetypes referenced by the type to be bound by this point.
656
+ // TODO: just make sure that we have a path to them that the debug info
657
+ // can follow.
658
+ if (!IGM.Opts .Optimize && Ty.getType ()->hasArchetype ())
659
+ Ty.getType ()->getCanonicalType ().visit ([&](Type t) {
660
+ if (auto archetype = dyn_cast<ArchetypeType>(CanType (t)))
661
+ emitTypeMetadataRef (archetype);
662
+ });
658
663
659
664
assert (IGM.DebugInfo && " debug info not enabled" );
660
665
if (ArgNo) {
Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ public class C<T>
9
9
// CHECK: %T = load %swift.type*, %swift.type**
10
10
// CHECK-SAME: !dbg ![[LOC:[0-9]+]], !invariant.load
11
11
// CHECK: ![[LOC]] = !DILocation(line: 0,
12
- var x = i
12
+ var x = [ i ]
13
13
}
14
14
}
15
15
You can’t perform that action at this time.
0 commit comments