File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed
include/swift/SILOptimizer/Utils Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -128,6 +128,11 @@ class OwnershipRAUWHelper {
128
128
// /
129
129
// / \p oldValue may be either a SingleValueInstruction or a terminator result.
130
130
// /
131
+ // / Precondition: If \p oldValue is a BorrowedValue that introduces a local
132
+ // / borrow scope, then \p newValue must either be defined in the same block as
133
+ // / \p oldValue, or it must dominate \p oldValue (rather than merely
134
+ // / dominating its uses).
135
+ // /
131
136
// / DISCUSSION: We do not check that the types line up here so that we can
132
137
// / allow for our users to transform our new value in ways that preserve
133
138
// / ownership at \p oldValue before we perform the actual RAUW. If \p newValue
@@ -168,6 +173,9 @@ class OwnershipRAUWHelper {
168
173
// / a single use of a value with another value with a different ownership. We
169
174
// / allow for the values to have different types.
170
175
// /
176
+ // / Precondition: if \p use ends a borrow scope, then \p newValue dominates the
177
+ // / BorrowedValue that begins the scope.
178
+ // /
171
179
// / NOTE: When not in OSSA, this just performs a normal set use, so this code is
172
180
// / safe to use with all code.
173
181
class OwnershipReplaceSingleUseHelper {
You can’t perform that action at this time.
0 commit comments