Skip to content

Commit 1fada55

Browse files
committed
[Gardening] Described states variable could be in.
1 parent 253888f commit 1fada55

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

lib/SILOptimizer/Transforms/SILMem2Reg.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -642,6 +642,12 @@ SILInstruction *StackAllocationPromoter::promoteAllocationInBlock(
642642

643643
// RunningVal is the current value in the stack location.
644644
// We don't know the value of the alloca until we find the first store.
645+
//
646+
// States:
647+
// - None: no values have been encountered within this block
648+
// - Some + !isStorageValid: a value was encountered but is no longer stored--
649+
// it has been destroy_addr'd, etc
650+
// - Some + isStorageValid: a value was encountered and is currently stored
645651
Optional<StorageStateTracking<LiveValues>> runningVals;
646652
// Keep track of the last StoreInst that we found and the BeginBorrowInst and
647653
// CopyValueInst that we created in response if the alloc_stack was lexical.

0 commit comments

Comments
 (0)