mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
This will make the forthcoming CanonicalizeInstruction interface more clear. This is generally the better approach to utilities that mutate the instruction stream. It avoids the temptation to assume that only a single instruction will be deleted or that only instructions before the current iterator will be deleted. This often happens to work but eventually fails in the presense of debug and end-of-scope instructions. A function returning an iterator has a more clear contract than one accepting some iterator reference of unknown providence. Unfortunately, it doesn't work at the lowest level of utilities, such as recursivelyDeleteTriviallyDeadInstructions, where we want to handle instruction batches.
24 KiB
24 KiB