-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[definite-init] Treat destroys of mark_uninitialized [var] container to be a load + destroy. #16844
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
SILBasicBlock::iterator InsertPt) { | ||
assert(ABI == Release->getOperand(0)); | ||
SILBuilderWithScope B(Release); | ||
B.setInsertionPoint(InsertPt); |
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.
Here you're updating the insertion point but not the debug scope. Is this intentional?
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 just followed the model in other parts of the file. If this is wrong then the other places are wrong as well.
I am going to get rid of the dead code commits in another PR to make this easier to review. |
9458cad
to
dfb8e89
Compare
@swift-ci smoke test |
b634507
to
6708e99
Compare
@swift-ci smoke test and merge |
4 similar comments
@swift-ci smoke test and merge |
@swift-ci smoke test and merge |
@swift-ci smoke test and merge |
@swift-ci smoke test and merge |
6708e99
to
4f83e63
Compare
I put in a special case for the lldb failures... = /. |
@swift-ci smoke test and merge |
…to be a load + destroy. This ensures that DI creates dealloc_box in cases where the box is uninitialized conditionally. In the process, I also discovered that we were missing a test case for DI being used by LLDB. Long term we shouldn't support that code pattern in the general case, but for now we at least need a test case for it. rdar://40332620
4f83e63
to
8886368
Compare
@swift-ci smoke test and merge |
This ensures that DI creates dealloc_box in cases where the box is uninitialized
conditionally, i.e.:
func foo() {
var k: Klass
if condition() { return } // <== We need to use a dealloc_box on k.
k = Klass()
}
rdar://40332620
I also deleted some dead code, so please look at just the last commit. I am going to squash at the end.