-
Notifications
You must be signed in to change notification settings - Fork 648
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix scoped loop generation for adding scopes
Summary: Prepare the scoped loop generation code for actually emitting scopes in each iteration of the loop. The key change is that the init statement also gets its own instance of the loop scope as opposed ot using the variables that store values between iterations. This also allows us to use stack locations to store the values between iterations, since we no longer evaluate expressions that may write to them. Apart from compliance for the init statement, this also means that each decl only has a single associated variable, and we don't need to `setDeclData` to keep updating it. This addresses a few other issues: 1. It is much easier to deal with debug information when a given decl is always found in the same environment at the same place. 2. Emitting the loop multiple times (due to try-finally for instance) can be easily set up to reuse the same variables every time. This is necessary so inner functions can access them correctly Reviewed By: tmikov Differential Revision: D58988827 fbshipit-source-id: 2492a230de0e0563bb26af18f0028ce60d90a206
- Loading branch information
1 parent
f5f07cb
commit ddc45e3
Showing
2 changed files
with
158 additions
and
145 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.