Skip to content

Commit d6efe55

Browse files
authored
Merge pull request #62508 from compnerd/workaround
2 parents d9382b1 + a630fa7 commit d6efe55

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

include/swift/SILOptimizer/Utils/UpdatingInstructionIterator.h

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -177,24 +177,24 @@ class UpdatingInstructionIteratorRegistry {
177177

178178

179179
public:
180-
UpdatingInstructionIteratorRegistry() :
181-
callbacks(InstModCallbacks()
180+
UpdatingInstructionIteratorRegistry() {
181+
callbacks = std::move(InstModCallbacks()
182182
.onDelete([this](SILInstruction *toDelete) {
183183
notifyDelete(toDelete);
184184
toDelete->eraseFromParent();
185185
})
186186
.onCreateNewInst(
187187
[this](SILInstruction *newlyCreatedInst) {
188188
notifyNew(newlyCreatedInst);
189-
}))
190-
{}
189+
}));
190+
}
191191

192192
UpdatingInstructionIteratorRegistry(InstModCallbacks &&chainedCallbacks) :
193193
// Copy the two std::functions that we need. The rest of the callbacks are
194194
// copied implicitly by assignment.
195195
chainedDelete(std::move(chainedCallbacks.deleteInstFunc)),
196-
chainedNew(std::move(chainedCallbacks.createdNewInstFunc)),
197-
callbacks(std::move(chainedCallbacks
196+
chainedNew(std::move(chainedCallbacks.createdNewInstFunc)) {
197+
callbacks = std::move(chainedCallbacks
198198
.onDelete([this](SILInstruction *toDelete) {
199199
notifyDelete(toDelete);
200200
if (chainedDelete) {
@@ -209,8 +209,8 @@ class UpdatingInstructionIteratorRegistry {
209209
if (chainedNew) {
210210
chainedNew(newlyCreatedInst);
211211
}
212-
})))
213-
{}
212+
}));
213+
}
214214

215215
// The callbacks capture 'this'. So copying is invalid.
216216
UpdatingInstructionIteratorRegistry(

0 commit comments

Comments
 (0)