Skip to content

Add @_weakSymbol and a corresponding SIL attribute #14660

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

jrose-apple
Copy link
Contributor

This is mostly intended to be used for testing at this point; in the long run, we want to be using availability information to decide whether to weak-link something or not. You'll notice a bunch of FIXMEs in the test case that we may not need now, but will probably need to handle in the future.

I snuck in a few cleanups while I was here, too.

Groundwork for doing backward-deployment execution tests.

@jrose-apple
Copy link
Contributor Author

@swift-ci Please test

@jrose-apple
Copy link
Contributor Author

I realized later that making this work with availability would probably be sufficient, since the runtime has a hook to pretend that it's on a certain version of a platform. But it's still simpler to just mark things as "weak".

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - a8ee4ebf654df6bdc7a3881dcbfdf5fbc4990fc5

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - a8ee4ebf654df6bdc7a3881dcbfdf5fbc4990fc5

@jrose-apple jrose-apple force-pushed the one-weak-since-you-looked-at-me branch from a8ee4eb to 06d8a4d Compare February 16, 2018 02:33
@jrose-apple
Copy link
Contributor Author

@jrose-apple jrose-apple force-pushed the one-weak-since-you-looked-at-me branch from 06d8a4d to 3066da2 Compare February 16, 2018 18:08
@jrose-apple
Copy link
Contributor Author

@swift-ci Please test

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - a8ee4ebf654df6bdc7a3881dcbfdf5fbc4990fc5

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - a8ee4ebf654df6bdc7a3881dcbfdf5fbc4990fc5

@jrose-apple
Copy link
Contributor Author

*sigh*

@jrose-apple jrose-apple force-pushed the one-weak-since-you-looked-at-me branch from 3066da2 to cc746ac Compare February 16, 2018 19:55
@jrose-apple
Copy link
Contributor Author

@swift-ci Please test

1 similar comment
@jrose-apple
Copy link
Contributor Author

@swift-ci Please test

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - 3066da205e761255502d1eedb77effd6a591cef4

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - 3066da205e761255502d1eedb77effd6a591cef4

@jckarter
Copy link
Contributor

Uncyclopedia‘s article for “weak symbol” is about the other definition of weak that we don’t mean here:

https://en.m.wikipedia.org/wiki/Weak_symbol

I hate to bikeshed an internal only name, but since confusion is likely here something else might be called for.

@jrose-apple
Copy link
Contributor Author

@_weakLinked, then?

Anything suspect on the technical side?

@jrose-apple
Copy link
Contributor Author

(The equivalent GCC attribute is spelled weakref, although they allow weak to be used for the same purpose in addition to using it for weak definitions.)

@jckarter
Copy link
Contributor

@_weakLinked sounds good to me.

...for no other reason than to slightly improve compile times
when something changes in SILModule.h or SILFunction.h.
And make it less likely to happen again in the future.
This is mostly intended to be used for testing at this point; in the
long run, we want to be using availability information to decide
whether to weak-link something or not. You'll notice a bunch of FIXMEs
in the test case that we may not need now, but will probably need to
handle in the future.

Groundwork for doing backward-deployment execution tests.
@jrose-apple jrose-apple force-pushed the one-weak-since-you-looked-at-me branch from cc746ac to bb33977 Compare February 21, 2018 01:56
@jrose-apple
Copy link
Contributor Author

@swift-ci Please smoke test

@jrose-apple
Copy link
Contributor Author

@swift-ci Please smoke test Linux

@jrose-apple jrose-apple merged commit 1785855 into swiftlang:master Feb 21, 2018
@jrose-apple jrose-apple deleted the one-weak-since-you-looked-at-me branch February 21, 2018 19:22
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.

3 participants