mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
* Add a new flag -experimental-package-cmo that requires -experimental-allow-non-resilient-access. * Support serializing package decls for CMO in package if enabled. * Only applies to default mode CMO. * Unlike the existing CMO, package CMO can be built with -enable-library-evolution as package modules are required to be built together in the same project. * Create hasPublicOrPackageVisibility to opt in for package decls; needed for CMO, SILVerifier, and other call sites that verify or determine codegen. Resolves rdar://121976014
35 lines
530 B
Swift
35 lines
530 B
Swift
|
|
public func incrementByOne(_ x: Int) -> Int {
|
|
return x + 1
|
|
}
|
|
|
|
package func subPkgFunc(_ x: Int) -> Int {
|
|
return x + 1
|
|
}
|
|
|
|
@_semantics("optimize.no.crossmodule")
|
|
public func incrementByOneNoCMO(_ x: Int) -> Int {
|
|
return x + 1
|
|
}
|
|
|
|
@_semantics("optimize.no.crossmodule")
|
|
package func subPkgFuncNoCMO(_ x: Int) -> Int {
|
|
return x + 1
|
|
}
|
|
|
|
public final class SubmoduleKlass {
|
|
public var i: Int
|
|
|
|
public init() {
|
|
i = 27
|
|
}
|
|
}
|
|
|
|
package final class PkgSubmoduleKlass {
|
|
package var i: Int
|
|
|
|
package init() {
|
|
i = 27
|
|
}
|
|
}
|