swift
2de13df9 - [region-isolation] Use SILIsolationInfo::initializeTrackableValue instead of SILIsolationInfo::mergeIsolationRegionInfo to fix last issue

Commit
1 year ago
[region-isolation] Use SILIsolationInfo::initializeTrackableValue instead of SILIsolationInfo::mergeIsolationRegionInfo to fix last issue When merging SILIsolationInfo for regions, we want to drop nonisolated(unsafe). This is important since nonisolated(unsafe) should only apply to the specific "value" that it belongs to, not the entire region. This creates a problem since in a few places in the code base we initialize a value (producing a disconnected value) and then initialize it by merging in an actor isolation. This no longer work since we will then always have nonisolated(unsafe) stripped, so no values would ever be considered to be nonisolated(unsafe). After analyzing the use case, I realized that these were just initialization patterns and in this commit, I added a specific initialization operation called SILIsolationInfo::initializeTrackableValue and eliminated those calls to SILIsolationInfo::mergeIsolationRegionInfo. Since SILIsolationInfo no longer has any merge operation on it, I then eliminated that code in this commit. This completes the behavior split that I put into the type system in the last commit. Specifically, I defined a composition type called SILDynamicMergedIsolationInfo. It represents a SILIsolationInfo that has been merged... that is why I called it the DynamicMergedIsolationInfo. It could probably use a better name = (. This fixes one of the last weird test case that I wrote where we were not letting through valid nonisolated(unsafe) code. At the same time, I discovered an additional issue (which can be seen in the TODOs in this commit), where we are being too conservative around a non-Sendable class var field. I am going to fix that in the next commit. rdar://128299305
Author
Committer
Parents
Loading