Skip to content

Commit 79bc4cb

Browse files
committed
[Mem2Reg] Lexical allocs create lexical borrows.
SILGen turns vars into alloc_boxes. When possible, AllocBoxToStack turns those into alloc_stacks. In order to preserve the lexical lifetime of those vars, the alloc_stacks are annotated with the [lexical] attribute. When Mem2Reg runs, it promotes the loads from and stores into those alloc_stacks to uses of registers. In order to preserve the lexical lifetime during that transformation, lexical borrow scopes must be introduces that encode the same lifetime as the alloc_stacks did. Here, that is done.
1 parent 16cbae3 commit 79bc4cb

File tree

2 files changed

+1296
-96
lines changed

2 files changed

+1296
-96
lines changed

0 commit comments

Comments
 (0)