Skip to content

[NFC] Add LoadBorrow::getEndBorrows() and minor cleanup. #24581

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 1 commit into from
May 7, 2019
Merged

[NFC] Add LoadBorrow::getEndBorrows() and minor cleanup. #24581

merged 1 commit into from
May 7, 2019

Conversation

atrick
Copy link
Contributor

@atrick atrick commented May 7, 2019

Instructions that start a scope should have a (discoverable) method
that retrieves the end of scope. This is a basic structural property
of the instruction.

I removed the makeEndBorrowRange helper because it adds overall
complexity and doesn't provide any value. If some code wants to be
generic over BeginBorrow/LoadBorrow, then that code should have it's
own trivial generic helper:

EndBorrowRange getEndBorrows(T *beginBorrow) {
return beginBorrow->getEndBorrows()
}

@atrick
Copy link
Contributor Author

atrick commented May 7, 2019

@swift-ci smoke test

Instructions that start a scope should have a (discoverable) method
that retrieves the end of scope. This is a basic structural property
of the instruction.

I removed the makeEndBorrowRange helper because it adds overall
complexity and doesn't provide any value. If some code wants to be
generic over BeginBorrow/LoadBorrow, then that code should have it's
own trivial generic helper:

EndBorrowRange getEndBorrows<T>(T *beginBorrow) {
  return beginBorrow->getEndBorrows()
}
@atrick
Copy link
Contributor Author

atrick commented May 7, 2019

@swift-ci smoke test

@atrick atrick changed the title Add LoadBorrow::getEndBorrows() and minor cleanup. [NFC] Add LoadBorrow::getEndBorrows() and minor cleanup. May 7, 2019
@gottesmm
Copy link
Contributor

gottesmm commented May 7, 2019

+1!

@atrick atrick merged commit 21f11ab into swiftlang:master May 7, 2019
@atrick atrick deleted the cleanup-end-borrow branch May 8, 2019 21:24
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