mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Implement the @export(implementation) and @export(interface) attributes to replace @_alwaysEmitIntoClient and @_neverEmitIntoClient. Provide a warning + Fix-It to start staging out the very-new @_neverEmitIntoClient. We'll hold off on pushing folks toward @_alwaysEmitIntoClient for a little longer.
67 lines
1.4 KiB
Swift
67 lines
1.4 KiB
Swift
// RUN: %empty-directory(%t)
|
|
// RUN: %target-swift-frontend -emit-module -o %t/indirects.swiftmodule \
|
|
// RUN: %S/../Sema/Inputs/implementation-only-imports/indirects.swift \
|
|
// RUN: -enable-experimental-feature Embedded
|
|
// RUN: %target-swift-frontend -emit-module -o %t/directs.swiftmodule -I %t\
|
|
// RUN: %S/../Sema/Inputs/implementation-only-imports/directs.swift \
|
|
// RUN: -enable-experimental-feature Embedded
|
|
|
|
// RUN: %target-swift-frontend -emit-sil %s -I %t \
|
|
// RUN: -enable-experimental-feature Embedded
|
|
|
|
// REQUIRES: swift_feature_Embedded
|
|
// REQUIRES: embedded_stdlib_cross_compiling
|
|
|
|
@_implementationOnly import directs
|
|
import indirects
|
|
|
|
internal func localInternalFunc() {}
|
|
|
|
public func implicitlyInlinablePublic() {
|
|
localInternalFunc()
|
|
}
|
|
|
|
private func implicitlyInlinablePrivate() {
|
|
localInternalFunc()
|
|
}
|
|
|
|
@export(interface)
|
|
public func explicitNonInliable() {
|
|
_ = StructFromDirect()
|
|
|
|
if (true) {
|
|
_ = StructFromDirect()
|
|
}
|
|
|
|
@export(interface)
|
|
func nested() {
|
|
_ = StructFromDirect()
|
|
}
|
|
nested()
|
|
|
|
localInternalFunc()
|
|
}
|
|
|
|
@export(implementation)
|
|
public func legalAccessToIndirect() {
|
|
_ = StructFromIndirect()
|
|
|
|
if (true) {
|
|
_ = StructFromIndirect()
|
|
}
|
|
|
|
func nested() {
|
|
_ = StructFromIndirect()
|
|
}
|
|
nested()
|
|
}
|
|
|
|
extension Array {
|
|
@export(implementation)
|
|
public var myMutableSpan: Int {
|
|
get {
|
|
return 0
|
|
}
|
|
}
|
|
}
|