Skip to content

Commit 0544a88

Browse files
authored
Merge pull request swiftlang#30226 from gottesmm/pr-7685cba8a8fe94412c5e6edd32dc419c03252b39
[gardening] Add comments explaining what alloc_stack [dynamic_lifetime] means.
2 parents d07ed46 + 974f62a commit 0544a88

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

include/swift/SIL/SILInstruction.h

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1444,7 +1444,18 @@ class AllocStackInst final
14441444
}
14451445
}
14461446

1447+
/// Set to true that this alloc_stack contains a value whose lifetime can not
1448+
/// be ascertained from uses.
1449+
///
1450+
/// As an example if an alloc_stack is known to be only conditionally
1451+
/// initialized.
14471452
void setDynamicLifetime() { dynamicLifetime = true; }
1453+
1454+
/// Returns true if the alloc_stack's initialization can not be ascertained
1455+
/// from uses directly (so should be treated conservatively).
1456+
///
1457+
/// An example of an alloc_stack with dynamic lifetime is an alloc_stack that
1458+
/// is conditionally initialized.
14481459
bool hasDynamicLifetime() const { return dynamicLifetime; }
14491460

14501461
/// Return the debug variable information attached to this instruction.

0 commit comments

Comments
 (0)