Skip to content

Don't consider external functions in inter-procedural analysis, like … #14516

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
Feb 10, 2018

Conversation

eeckstein
Copy link
Contributor

…side-effect or escape analysis.

The behavior of functions in other libraries may change in past/future versions of the library. So the compiler should not make any assumptions about them.

rdar://problem/32275048

…side-effect or escape analysis.

The behavior of functions in other libraries may change in past/future versions of the library. So the compiler should not make any assumptions about them.

rdar://problem/32275048
@eeckstein
Copy link
Contributor Author

@swift-ci smoke test and merge

@swift-ci swift-ci merged commit c4da61c into swiftlang:master Feb 10, 2018
@jrose-apple
Copy link
Contributor

This is conservative but not really what we want, especially since you've applied it to all functions and not just those that come from resilient modules. Also, does it include shared_external functions, which will get re-emitted anyway?

@eeckstein
Copy link
Contributor Author

@jrose-apple good point about shared_external. I'll exclude such functions.

How do I check if a function comes from a non-resilient module?

@jrose-apple
Copy link
Contributor

The ModuleDecl that the ModuleFile is attached to knows, but I don't think SIL functions store their origin at the moment. It might need to be something we track on SIL functions. (We already have getResilienceExpansion() there, but that's designed for the defining side, not the calling side.)

@atrick may have some thoughts here. (And Slava, of course, when he gets back.)

@atrick
Copy link
Contributor

atrick commented Feb 12, 2018

I don't have a better idea. I think it's safer to add an explicit flag with asserts rather than overload existing flags with new meanings.

eeckstein added a commit to eeckstein/swift that referenced this pull request Feb 12, 2018
@eeckstein eeckstein deleted the fix-ip-analysis branch April 17, 2021 15:01
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.

4 participants