Skip to content

Commit f707d8a

Browse files
committed
ObjectOutliner: isValidUseOfObject(Instruction) -> isValidUseOfObject(Operand)
1 parent 0ac83f1 commit f707d8a

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

SwiftCompilerSources/Sources/Optimizer/FunctionPasses/ObjectOutliner.swift

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ private func findInitStores(of object: Value,
147147
return false
148148
}
149149
default:
150-
if !isValidUseOfObject(use.instruction) {
150+
if !isValidUseOfObject(use) {
151151
return false
152152
}
153153
}
@@ -184,7 +184,7 @@ private func findStores(toTailAddress tailAddr: Value, tailElementIndex: Int, st
184184
return false
185185
}
186186
default:
187-
if !isValidUseOfObject(use.instruction) {
187+
if !isValidUseOfObject(use) {
188188
return false
189189
}
190190
}
@@ -198,7 +198,7 @@ private func findStores(inUsesOf address: Value, index: Int, stores: inout [Stor
198198
if !handleStore(store, index: index, stores: &stores) {
199199
return false
200200
}
201-
} else if !isValidUseOfObject(use.instruction) {
201+
} else if !isValidUseOfObject(use) {
202202
return false
203203
}
204204
}
@@ -215,7 +215,8 @@ private func handleStore(_ store: StoreInst, index: Int, stores: inout [StoreIns
215215
return false
216216
}
217217

218-
private func isValidUseOfObject(_ inst: Instruction) -> Bool {
218+
private func isValidUseOfObject(_ use: Operand) -> Bool {
219+
let inst = use.instruction
219220
switch inst {
220221
case is DebugValueInst,
221222
is LoadInst,
@@ -240,7 +241,7 @@ private func isValidUseOfObject(_ inst: Instruction) -> Bool {
240241
is RefTailAddrInst,
241242
is RefElementAddrInst:
242243
for use in (inst as! SingleValueInstruction).uses {
243-
if !isValidUseOfObject(use.instruction) {
244+
if !isValidUseOfObject(use) {
244245
return false
245246
}
246247
}

0 commit comments

Comments
 (0)