You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: SwiftCompilerSources/Sources/Optimizer/Utilities/ForwardingUtils.swift
+87-14Lines changed: 87 additions & 14 deletions
Original file line number
Diff line number
Diff line change
@@ -1,4 +1,4 @@
1
-
//===--- OwnershipUtils.swift - Utilities for ownership -------------------===//
1
+
//===--- ForwardingUtils.swift - Utilities for ownership forwarding -------===//
2
2
//
3
3
// This source file is part of the Swift.org open source project
4
4
//
@@ -29,8 +29,6 @@ import SIL
29
29
//
30
30
// Note: Although move_value conceptually forwards an owned value, it also summarizes lifetime attributes; therefore, it is not formally a ForwardingInstruction.
31
31
//
32
-
// TODO: when phi lifetime flags are implemented, phis will introduce a lifetime in the same way as move_value.
33
-
//
34
32
// The lifetime introducer of a guaranteed value is the borrow introducer:
35
33
//
36
34
// # lifetime introducer / borrow introducer
@@ -43,11 +41,25 @@ import SIL
43
41
//
44
42
// TODO: When a begin_borrow has no lifetime flags, it can be ignored as a lifetime introducer. In that case, an owned value may introduce guaranteed OSSA lifetimes.
45
43
//
44
+
// Forwarded lifetimes also extend through phis. In this case, however, there is no ForwardingInstruction.
// TODO: when phi lifetime flags are implemented, phis will introduce a lifetime in the same way as move_value.
57
+
//
46
58
// This walker is used to query basic lifetime attributes on values, such as "escaping" or "lexical". It must be precise for correctness and is performance critical.
// This conveniently allows a closure to be called for each leaf use of a forward-extended lifetime. It should be called on a forward introducer provided by ForwardingDefUseWalker.introducer() or gatherLifetimeIntroducers().
157
209
//
158
210
// TODO: make the visitor non-escaping once Swift supports stored non-escaping closues.
0 commit comments