Skip to content

Commit d0443be

Browse files
committed
Expose the InstructionDeleter's callbacks
so they don't need to be passed around on the side everywhere.
1 parent b734bb3 commit d0443be

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

include/swift/SILOptimizer/Utils/InstOptUtils.h

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -248,12 +248,12 @@ class InstructionDeleter {
248248
InstructionDeleter(InstModCallbacks chainedCallbacks = InstModCallbacks())
249249
: deadInstructions(), iteratorRegistry(chainedCallbacks) {}
250250

251-
InstModCallbacks &getCallbacks() { return iteratorRegistry.getCallbacks(); }
252-
253251
UpdatingInstructionIteratorRegistry &getIteratorRegistry() {
254252
return iteratorRegistry;
255253
}
256254

255+
InstModCallbacks &getCallbacks() { return iteratorRegistry.getCallbacks(); }
256+
257257
llvm::iterator_range<UpdatingInstructionIterator>
258258
updatingRange(SILBasicBlock *bb) {
259259
return iteratorRegistry.makeIteratorRange(bb);
@@ -264,6 +264,12 @@ class InstructionDeleter {
264264
return iteratorRegistry.makeReverseIteratorRange(bb);
265265
}
266266

267+
bool hadCallbackInvocation() const {
268+
return const_cast<InstructionDeleter *>(this)
269+
->getCallbacks()
270+
.hadCallbackInvocation();
271+
}
272+
267273
/// If the instruction \p inst is dead, record it so that it can be cleaned
268274
/// up.
269275
///

0 commit comments

Comments
 (0)