Skip to content

Commit 05dc240

Browse files
committed
[embedded] Make sure to drop all references before deleting functions and globals in DropAllSILPass
1 parent 90e7595 commit 05dc240

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

lib/SILOptimizer/UtilityPasses/DropAllSILPass.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,12 @@ class DropAllSILPass : public SILModuleTransform {
3030
llvm::SmallVector<SILGlobalVariable *, 16> GlobalsToErase;
3131

3232
for (SILFunction &F : M) {
33+
F.dropAllReferences();
3334
FunctionsToErase.push_back(&F);
3435
}
3536

3637
for (SILGlobalVariable &G : M.getSILGlobals()) {
38+
G.dropAllReferences();
3739
GlobalsToErase.push_back(&G);
3840
}
3941

0 commit comments

Comments
 (0)