-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[DefiniteInitialization] Check whether globals captured by top-level defer statements are initialized. #17542
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
Conversation
@swift-ci please smoke test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
@swift-ci please smoke test |
Pushed a new commit that resolves merge conflicts |
@@ -1243,10 +1244,13 @@ void LifetimeChecker::handleEscapeUse(const DIMemoryUse &Use) { | |||
|
|||
Diag<StringRef, bool> DiagMessage; | |||
if (isa<MarkFunctionEscapeInst>(Inst)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add comments here explaining why this code is arranged this way and how that maps to code? The reason I am asking is that you have this paged into your head right now. We should document this behavior.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am fine if you want to do that in a subsequent commit.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay. I have added some explanation to this piece of code. My exact change here is to just introduce a new else if
condition to the logic in the "MarkFunctionEscapeInst" branch, which is something I understand well. The rest of the logic existed before. However, I have documented my overall understanding of the code here.
defer statements are initialized. <rdar://30720636>
@swift-ci please smoke test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thats better than what we have here. I think the prose can be cleaned up, but I think you are leaving this better than you found it, so I am fine with it.
@swift-ci please test and merge |
1 similar comment
@swift-ci please test and merge |
rdar://30720636