mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[sil-optimizer] Get rid of the InstModCallback constructors in favor of onDelete/onCreatedNewInst/etc.
Without this when constructing an InstModCallback it is hard to distinguish which closure is meant for which operation when passed to the constructor of InstModCallback (if this was in Swift, we could use argument labels, but we do not have such things in c++). This new value type sort of formulation makes it unambiguous which callback is used for what when constructing one of these.
This commit is contained in:
@@ -783,7 +783,7 @@ void TempRValueOptPass::run() {
|
||||
}
|
||||
}
|
||||
|
||||
InstModCallbacks callbacks(
|
||||
auto callbacks = InstModCallbacks().onDelete(
|
||||
[](SILInstruction *instToKill) {
|
||||
// SimplifyInstruction is not in the business of removing
|
||||
// copy_addr. If it were, then we would need to update deadCopies.
|
||||
|
||||
Reference in New Issue
Block a user