File tree 2 files changed +6
-0
lines changed 2 files changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -362,6 +362,8 @@ class DeadFunctionAndGlobalElimination {
362
362
ensureKeyPathComponentIsAlive (component);
363
363
} else if (auto *GA = dyn_cast<GlobalAddrInst>(&I)) {
364
364
ensureAlive (GA->getReferencedGlobal ());
365
+ } else if (auto *agi = dyn_cast<AllocGlobalInst>(&I)) {
366
+ ensureAlive (agi->getReferencedGlobal ());
365
367
} else if (auto *GV = dyn_cast<GlobalValueInst>(&I)) {
366
368
ensureAlive (GV->getReferencedGlobal ());
367
369
} else if (auto *HSI = dyn_cast<HasSymbolInst>(&I)) {
Original file line number Diff line number Diff line change @@ -6,6 +6,9 @@ sil_stage canonical
6
6
import Builtin
7
7
import Swift
8
8
9
+ // CHECK-LABEL: sil_global private @privateGlobal
10
+ sil_global private @privateGlobal : $Int64
11
+
9
12
// This function needs to be removed.
10
13
// KEEP-NOT: @remove_me
11
14
@@ -25,6 +28,7 @@ sil_global @globalFunctionPointer : $@callee_guaranteed () -> () = {
25
28
// CHECK-LABEL: sil private @alivePrivateFunc
26
29
sil private @alivePrivateFunc : $@convention(thin) () -> () {
27
30
bb0:
31
+ alloc_global @privateGlobal
28
32
%0 = tuple ()
29
33
return %0 : $()
30
34
}
You can’t perform that action at this time.
0 commit comments