mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
When an instruction is "deleted" from the SIL, it is put into the SILModule::scheduledForDeletion list. The instructions in this list are eventually deleted for real in SILModule::flushDeletedInsts(), which is called by the pass manager after each pass run. In other words: instruction deletion is deferred to the end of a pass. This avoids dangling instruction pointers within the run of a pass and in analysis caches. Note that the analysis invalidation mechanism ensures that analysis caches are invalidated before flushDeletedInsts().
36 KiB
36 KiB