Skip to content

Splitting arg scopes and indirect result initializers. #8073

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

gottesmm
Copy link
Contributor

This PR splits the scopes of arguments and indirect result initializers. It will enable the creation of a special call scope around argument emission whose purpose is to ensure that cleanups produced during argument emission are always cleaned up immediately after the call rather than at end of scope.

The first two commits are strictly NFC refactorings. The third commit moves ResultPlan outside of SILGenApply and hoists ResultPlan's initialization creation before any argument emission occurs. This does perturb the SIL slightly by increasing some stack location live ranges. This does not cause the values that are stored in the stack values to have a longer life though.

rdar://30955427

…alleeTypeInfo.

This structure contains all of the type information that we use to build a
ResultPlanPtr. In a subsequent commit, I am going to move ResultPlanPtr creation
out of emitApply and place it before the creation of arguments. This is to
enable indirect result initializations to belong to the scope outside of any
argument based scopes.

Without this the lifetimes of the indirect result initializations and arguments
can not be separated without using hacks. There is no reason why we can't emit
the indirect result temporaries before we emit any arguments since they will
remain dormant until after the final apply/any future committed argument scopes
being popped.

rdar://30955427
…tore it. Just generate it dynamically.

This is being done in preparation for moving ResultPlan /out of/
SILGenFunction::apply.

rdar://30955427
… untangle indirect result/normal argument lifetime scopes.

rdar://30955427
@gottesmm
Copy link
Contributor Author

@swift-ci Please smoke test and merge

@swift-ci swift-ci merged commit 9afe41b into swiftlang:master Mar 14, 2017
@gottesmm gottesmm deleted the splitting_arg_scopes_and_indirect_result_scopes branch March 14, 2017 08:32
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