-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Rebase SILScope generation on top of ASTScope. #64941
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
adrian-prantl
merged 14 commits into
swiftlang:release/5.9
from
adrian-prantl:88274783-5.9
Apr 17, 2023
Merged
Rebase SILScope generation on top of ASTScope. #64941
adrian-prantl
merged 14 commits into
swiftlang:release/5.9
from
adrian-prantl:88274783-5.9
Apr 17, 2023
Conversation
This file contains hidden or 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
@swift-ci test |
test with swiftlang/llvm-project#6611 |
DougGregor
reviewed
Apr 6, 2023
DougGregor
approved these changes
Apr 6, 2023
@swift-ci test |
1 similar comment
@swift-ci test |
870f991
to
017260b
Compare
@swift-ci test |
and also make it easier to debug. (cherry picked from commit bbcce34)
The pointsToEnd flag is only meaningful when combined with an AST node, and moving it into the AST pointer frees up a bit in the flags bitfield for later use. (cherry picked from commit 63304d0)
This change aims at reducing the need for SIL passes to check into the AST storage of SILLocations. The end goal is to eventually merge this with the autogenerated flag, but at the moment the emergent semantics of both properties are not identical. (cherry picked from commit c5efebe)
(cherry picked from commit 0337ea9)
This patch replaces the stateful generation of SILScope information in SILGenFunction with data derived from the ASTScope hierarchy, which should be 100% in sync with the scopes needed for local variables. The goal is to eliminate the surprising effects that the stack of cleanup operations can have on the current state of SILBuilder leading to a fully deterministic (in the sense of: predictible by a human) association of SILDebugScopes with SILInstructions. The patch also eliminates the need to many workarounds. There are still some accomodations for several Sema transformation passes such as ResultBuilders, which don't correctly update the source locations when moving around nodes. If these were implemented as macros, this problem would disappear. This necessary rewrite of the macro scope handling included in this patch also adds proper support nested macro expansions. This fixes rdar://88274783 and either fixes or at least partially addresses the following: rdar://89252827 rdar://105186946 rdar://105757810 rdar://105997826 rdar://105102288 (cherry picked from commit 158772c)
rdar://105997826 (cherry picked from commit 475f779)
(cherry picked from commit e3445a8)
rdar://107764966 (cherry picked from commit c877a4a)
(cherry picked from commit bccc080)
(cherry picked from commit e51937f)
(cherry picked from commit 8d6c55e)
This is something that every visit() function needs to do and these manual overloads forgot to. I tried to come up with a more general solution, but due the rather nested inheritance of SILCloner this turned out harde than expected. rdar://107984038 (cherry picked from commit fbf4c92)
(cherry picked from commit b6be6ad)
…ted. If a pattern reuses a value from a previous branch this could result in a step backwords or a previous scope being reopeneed. rdar://107764966 (cherry picked from commit 68aa944)
4e04068
to
979d72c
Compare
Fix one more bug that was uncovered by the di-hole verification when building the source compatibility suite in debug mode. |
@swift-ci test |
@swift-ci test source compatibility |
Source compatibility failures are unrelated to this PR. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Rebase SILScope generation on top of ASTScope.
This patch replaces the stateful generation of SILScope information in SILGenFunction with data derived from the ASTScope hierarchy, which should be 100% in sync with the scopes needed for local variables. The goal is to eliminate the surprising effects that the stack of cleanup operations can have on the current state of SILBuilder leading to a fully deterministic (in the sense of: predictible by a human) association of SILDebugScopes with SILInstructions. The patch also eliminates the need to many workarounds. Thereare still some accomodations for several Sema transformation passes such as ResultBuilders, which don't correctly update the source locations when moving round nodes. If these were implemented as macros, this problem would disappear.
This necessary rewrite of the macro scope handling included in this patch also adds proper support nested macro expansions.
This fixes
rdar://88274783
and either fixes or at least partially addresses the following:
rdar://89252827
rdar://105186946
rdar://105757810
rdar://105997826
rdar://105102288
Cherry pick of #64551.