File tree Expand file tree Collapse file tree 1 file changed +10
-3
lines changed
SwiftCompilerSources/Sources/Optimizer/PassManager Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -79,16 +79,23 @@ extension MutatingContext {
79
79
_bridged. eraseInstruction ( instruction. bridged)
80
80
}
81
81
82
- func erase( instructionIncludingDebugUses inst: Instruction ) {
82
+ func erase( instructionIncludingAllUsers inst: Instruction ) {
83
+ if inst. isDeleted {
84
+ return
85
+ }
83
86
for result in inst. results {
84
87
for use in result. uses {
85
- assert ( use. instruction is DebugValueInst , " instruction to delete may only have debug_value uses " )
86
- erase ( instruction: use. instruction)
88
+ erase ( instructionIncludingAllUsers: use. instruction)
87
89
}
88
90
}
89
91
erase ( instruction: inst)
90
92
}
91
93
94
+ func erase( instructionIncludingDebugUses inst: Instruction ) {
95
+ precondition ( inst. results. allSatisfy { $0. uses. ignoreDebugUses. isEmpty } )
96
+ erase ( instructionIncludingAllUsers: inst)
97
+ }
98
+
92
99
func erase( block: BasicBlock ) {
93
100
_bridged. eraseBlock ( block. bridged)
94
101
}
You can’t perform that action at this time.
0 commit comments