Skip to content

[sil] Change two SILInstruction::removeFromParent => SILInstruction::eraseFromParent. #10145

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
merged 2 commits into from
Jun 7, 2017

Conversation

gottesmm
Copy link
Contributor

@gottesmm gottesmm commented Jun 6, 2017

[sil] Change two SILInstruction::removeFromParent => SILInstruction::eraseFromParent.

removeFromParent should only be used when one is moving a SILInstruction from
one block to another or in preparation for deleting an instruction. In this
case, we are removing these two SILInstructions from their parent block and
leaking the instruction. The right thing to do is to use eraseFromParent.

rdar://problem/31276565

gottesmm added 2 commits June 6, 2017 10:12
…asicBlock>.

addNodeToList only needs to be implemented to override the default callback
behavior of ilist_trait_defaults<SILBasicBlock>.  This implmentation in
ilist_traits<SILBasicBlock> is exactly the same as the default callback so is
unnecessary.
…eraseFromParent.

removeFromParent should only be used when one is moving a SILInstruction from
one block to another or in preparation for deleting an instruction. In this
case, we are removing these two SILInstructions from their parent block and
leaking the instruction. The right thing to do is to use eraseFromParent.

<rdar://problem/31276565>
@gottesmm
Copy link
Contributor Author

gottesmm commented Jun 6, 2017

@swift-ci smoke test

@swiftix
Copy link
Contributor

swiftix commented Jun 6, 2017

Nice catch!

@gottesmm gottesmm merged commit 46ed599 into swiftlang:master Jun 7, 2017
@gottesmm gottesmm deleted the plugging_leaks_1 branch June 7, 2017 06:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants