-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Swift 5.1 branch rdar47467128 part1 #23449
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
gottesmm
merged 2 commits into
swiftlang:swift-5.1-branch
from
gottesmm:swift-5.1-branch-rdar47467128-part1
Mar 21, 2019
Merged
Swift 5.1 branch rdar47467128 part1 #23449
gottesmm
merged 2 commits into
swiftlang:swift-5.1-branch
from
gottesmm:swift-5.1-branch-rdar47467128-part1
Mar 21, 2019
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
… a different var decl. I did not wire anything up to it. This is in preparation for fixing issues around SILGenPattern fallthrough emission and bad rename/edit all in scope of case stmt var decls. Specifically, I am going to ensure that we can get from any VarDecl in the following to any other VarDecl: switch x { case .a(let v1, let v2), .b(let v1, let v2): ... fallthrough case .c(let v1, let v2), .d(let v1, let v2): ... } This will be done by: 1. Pointing the var decls in .d at the corresponding var decls in .c. 2. Pointing the var decls in .c at the corresponding var decls in .b. 3. Pointing the var decls in .b at the corresponding var decls in .a. 4. Pointing the var decls in .a at the case stmt. Recognizing that we are asking for the next VarDecl, but have a case stmt, we check if we have a fallthrough case stmt (which I am going to add in a subsequent commit). If so, follow down the fallthrough case stmts until you find a fallthrough case stmt that doesn't fallthrough itself and then return the corresponding var decl in the last case label item in that var decl (in the above .d). I also put in some asserts to make sure that we never try to vend a parent value that is a nullptr. rdar://47467128 (cherry picked from commit 500f34c)
This is in preparation for fixing issues around SILGenPattern fallthrough emission and bad rename/edit all in scope of case stmt var decls. Specifically, I am going to ensure that we can get from any VarDecl in the following to any other VarDecl: switch x { case .a(let v1, let v2), .b(let v1, let v2): ... fallthrough case .c(let v1, let v2), .d(let v1, let v2): ... } This will be done by: 1. Pointing the var decls in .d at the corresponding var decls in .c. 2. Pointing the var decls in .c at the corresponding var decls in .b. 3. Pointing the var decls in .b at the corresponding var decls in .a. 4. Pointing the var decls in .a at the case stmt. Recognizing that we are asking for the next VarDecl, but have a case stmt, we check if we have a fallthrough case stmt. If so, follow down the fallthrough case stmts until you find a fallthrough case stmt that doesn't fallthrough itself and then return the corresponding var decl in the last case label item in that var decl (in the above .d). In a subsequent commit I am going to add case body var decls. The only change as a result of that is that I will insert them into the VarDecl double linked list after the last case var decl of each case stmt. (cherry picked from commit b1a7b48)
@swift-ci test |
akyrtzi
approved these changes
Mar 20, 2019
@shahmishal Do you know why the tests didn't trigger here? |
You linked the wrong PR in your description :) |
@slavapestov oops... you are right! The right one is: #23378 |
Looks like it was a bad autocomplete via github. |
@swift-ci test |
1 similar comment
@swift-ci test |
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.
Cherry-picking #23320 23378 to 5.1 branch.
rdar://problem/47467128
EDIT: This is a cherry-pick actually of PR: #23378.