Skip to content

[sil-combine] Use high level ARC APIs instead of low level ARC APIs in a few cases to make code work in ossa and non-ossa. #35046

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

Conversation

gottesmm
Copy link
Contributor

These are just a few cases where I could 1-1 translate the APIs to do the correct thing in both OSSA and non-OSSA.

…n a few cases to make code work in ossa and non-ossa.
@@ -1416,7 +1418,7 @@ static void emitMatchingRCAdjustmentsForCall(ApplyInst *Call, SILValue OnX) {

// Emit a retain for the @owned return.
SILBuilderWithScope Builder(Call);
Builder.createRetainValue(Call->getLoc(), OnX, Builder.getDefaultAtomicity());
OnX = Builder.emitCopyValueOperation(Call->getLoc(), OnX);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One thing to be aware of is that when we compile without ownership, we return the retain_value's operand here.

@gottesmm
Copy link
Contributor Author

@swift-ci smoke test

@gottesmm gottesmm merged commit 58ff39b into swiftlang:main Dec 11, 2020
@gottesmm gottesmm deleted the pr-2511f2f686454ddb2d288c821d750999c44bbbd6 branch December 11, 2020 04:25
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.

1 participant