Skip to content
This repository has been archived by the owner on Mar 28, 2020. It is now read-only.
/ swift-llvm Public archive

Fix swift error throwing on non-darwin ARM platforms #55

Closed
wants to merge 1 commit into from

Conversation

johnno1962
Copy link

A minor change to get Swift Error throwing to work on non-darwin ARM32 platforms (e.g. Android.) Without this change, code generated saves and restores ARM register r8 at the entry and returns of a function that throws. As r8 is used as a virtual return value for the object being thrown this gets overwritten by the restore and calling code is unable to catch the error. This was causing do/try/catch not to work on Android as it is an ARM32 platform that does not satisfy "STI.isTargetDarwin()"

Addresses SR-5438

@johnno1962 johnno1962 changed the title Fix swift error throwing on non-darwin platforms Fix swift error throwing on non-darwin ARM platforms Jul 23, 2017
@johnno1962 johnno1962 changed the title Fix swift error throwing on non-darwin ARM platforms do not merge - Fix swift error throwing on non-darwin ARM platforms Jul 23, 2017
@johnno1962
Copy link
Author

There was an issue but it’s been resolved by completely clearing out the build directory and restarting. This looks good to go.

@johnno1962 johnno1962 changed the title do not merge - Fix swift error throwing on non-darwin ARM platforms Fix swift error throwing on non-darwin ARM platforms Jul 23, 2017
@jrose-apple jrose-apple requested a review from rjmccall July 24, 2017 18:11
@rjmccall
Copy link
Member

Yes, this looks right to me.

@rjmccall
Copy link
Member

Ideally Manman Ren would review this, but she's no longer working on this project.

@rjmccall
Copy link
Member

rjmccall commented Jul 25, 2017

This patch should go into the main LLVM repository, though.

@rjmccall
Copy link
Member

@aschwaighofer Please review and help this land in LLVM.

@johnno1962
Copy link
Author

Thanks @rjmccall, @aschwaighofer, I think I have found someone to propose this patch to llvm - @modocache

@johnno1962
Copy link
Author

Awaiting review on llvm: https://reviews.llvm.org/D35835

@aschwaighofer
Copy link
Member

@modocache @johnno1962 The change looks good but needs a test case. I have left a review at the llvm's review site.

Thank you!

@johnno1962
Copy link
Author

@aschwaighofer , @rjmccall. I understand this patch has landed in llvm trunk if you want to cherry-pick it up. Thanks @modocache.

@johnno1962
Copy link
Author

Seems like you’ve picked this up. I’ll close the PR now - Thanks!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants