mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
This will let the performance inliner inline a function even if the costs are too high. This attribute is only a hint to the inliner. If the inliner has other good reasons not to inline a function, it will ignore this attribute. For example if it is a recursive function (which is currently not supported by the inliner). Note that setting the inline threshold to 0 does disable performance inlining at all and in this case also the @inline(__always) has no effect. Swift SVN r21452
14 lines
206 B
Swift
14 lines
206 B
Swift
@inline(__always) public func testAlwaysInline(#x: Bool) -> Bool {
|
|
return x
|
|
}
|
|
|
|
public struct AlwaysInlineInitStruct {
|
|
var x: Bool
|
|
|
|
@inline(__always)
|
|
public init(x x2: Bool) {
|
|
self.x = x2
|
|
}
|
|
}
|
|
|