-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Stabilize and simplify SIL linkage and serialization #41703
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
Conversation
@swift-ci test |
@swift-ci benchmark |
@swift-ci Please test compiler performance |
@swift-ci benchmark |
1 similar comment
@swift-ci benchmark |
@swift-ci Please test compiler performance |
@swift-ci test macOS |
1 similar comment
@swift-ci test macOS |
398ce07
to
447d13d
Compare
@swift-ci test |
@swift-ci benchmark |
447d13d
to
ef18209
Compare
@swift-ci test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a nice conceptual simplification, thank you!
include/swift/SIL/SILLinkage.h
Outdated
@@ -38,33 +38,51 @@ enum class SILLinkage : uint8_t { | |||
/// This object definition is visible to multiple Swift modules (and | |||
/// thus potentially across linkage-unit boundaries). There are no | |||
/// other object definitions with this name in the program. | |||
/// | |||
/// Public functions must be definitions, i.e. must have a body, except they | |||
/// are clang imported. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nitpick -- s/clang imported/body emitted by clang/? This is only true in a few narrow cases like bitfield accessors and static inline functions IIRC
ef18209
to
3ff72d4
Compare
@swift-ci test |
@swift-ci benchmark |
The main point of this change is to make sure that a shared function always has a body: both, in the optimizer pipeline and in the swiftmodule file. This is important because the compiler always needs to emit code for a shared function. Shared functions cannot be referenced from outside the module. In several corner cases we missed to maintain this invariant which resulted in unresolved-symbol linker errors. As side-effect of this change we can drop the shared_external SIL linkage and the IsSerializable flag, which simplifies the serialization and linkage concept.
3ff72d4
to
6a020f8
Compare
@swift-ci test |
The main point of this change is to make sure that a shared function always has a body: both, in the optimizer pipeline and in the swiftmodule file.
This is important because the compiler always needs to emit code for a shared function. Shared functions cannot be referenced from outside the module.
In several corner cases we missed to maintain this invariant which resulted in unresolved-symbol linker errors.
As side-effect of this change we can drop the shared_external SIL linkage and the IsSerializable flag, which simplifies the serialization and linkage concept.