Skip to content

Scope arg transforms 1 #8285

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 4 commits into from
Mar 22, 2017
Merged

Conversation

gottesmm
Copy link
Contributor

This PR does a few things:

  1. CleanupCloner is exposed in SILGenBuilder.h. CleanupCloner takes an imprint of a ManagedValue so you can recreate the type of cleanup of that ManagedValue later on a (potentially different) SILValue.
  2. Scope::popPreservingValue(ManagedValue) is defined. This method on Scope uses CleanupCloner to push the preserved value into the outside Scope by forwarding the cleanup and recreating the cleanup on the original value.
  3. 2 parts of ArgEmitter are scoped using popPreservingValue to push through the underlying argument from an internal ArgEmitter scope into an outside apply emission scope.

rdar://31145255

…LGenFunction/SILLocation.

This just automates the work of:

1. Grabbing the cleanup manager from the SGF.
2. Forming a CleanupLocation from a SILLocation.

Much of the time when one creates a scope, that is the information that one has
available. So lets make it... wait for it... convenient to construct a scope
with this data.
What this routine does is:

1. "Imprints" a cleanup cloner with the managed value.
2. Forwards the managed value.
3. Pop the scope.
4. Use the imprinted cleanup cloner to recreate the managed value in the scope
outside of the current scope.
…ent} using popPreservingValue to move its result into the outer scope.

rdar://31145255
@gottesmm
Copy link
Contributor Author

@swift-ci smoke test and merge

@swift-ci swift-ci merged commit 86ac28c into swiftlang:master Mar 22, 2017
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