Skip to content

EndBorrow support in LLVMPasses #5332

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 5 commits into from
Oct 17, 2016

Conversation

gottesmm
Copy link
Contributor

This PR does a few things:

  1. I discovered that the fixLifetime test was not actually testing anything. I fixed the test so we are actually testing that we remove fixLifetime in SwiftARCContract.
  2. I refactored a bunch of the code related to the LLVMPasses recognizing functions so that the code is more maintainable. This was done using the new LLVMSwift.def metaprogramming header file. Now entry point parsing, creating RT_Kind enum cases, and base modref support are implemented without any further work.
  3. I added support for SwiftARCContract removing an LLVM declaration that represents the end_borrow instruction in SIL: swift_endBorrow(i8, i8). I used i8* here since borrowing can occur in between trivial types just as much as heap types, so I am being careful. That can always be changed if we so choose.

rdar://problem/28685236

…ly tests something.

Evidently this has been silently not testing anything for a while. Luckily, the
functionality seems not to be broken, just the test. Also IRGen is emitting the
correct function name as well.
… in LLVM.

For semantic ARC I need to add an endBorrow entrypoint that will be removed by
ARCContract.cpp. In the process I am doing a little bit of cleanup.

In this commit, I only use this to generate the enum RT_Kind in LLVMARCOpts.h. I
verified it was the same using a diff tool. I am going to do further updates in
subsequent commits to make the diff easy to see.
@gottesmm
Copy link
Contributor Author

@swift-ci Please smoke test and merge

@gottesmm
Copy link
Contributor Author

Looks like the Linux failure is unrelated to my commit (some failure in Foundation about downloading from a URL). Lets try again!

@gottesmm
Copy link
Contributor Author

@swift-ci Please smoke test linux platform

@gottesmm gottesmm merged commit dfca714 into swiftlang:master Oct 17, 2016
@gottesmm gottesmm deleted the semantic_arc_endborrow_llvmpasses branch October 17, 2016 23:41
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