Remove @transparent from a few functions in the stdlib.

Marking these generic functions as transparent results in our not
emitting diagnostics for unreachable code if these functions are the
only code in a block and inlining generic code is enabled (due to
<rdar://problem/17687851>).

I don't believe other diagnostics benefit in any way from having these
marked as @transparent, and removing @transparent actually improved
Ackerman at -O3 by 15%.

Swift SVN r19996
This commit is contained in:
Mark Lacey
2014-07-16 01:22:59 +00:00
parent 19488ac835
commit 36b035b93b

View File

@@ -100,13 +100,13 @@ public protocol _ForwardIndexType : _Incrementable {
typealias _DisabledRangeIndex = _DisabledRangeIndex_
}
@transparent prefix public
prefix public
func ++ <T : _Incrementable> (inout x: T) -> T {
x = x.successor()
return x
}
@transparent postfix public
postfix public
func ++ <T : _Incrementable> (inout x: T) -> T {
var ret = x
x = x.successor()
@@ -192,14 +192,14 @@ public protocol _BidirectionalIndexType : _ForwardIndexType {
public protocol BidirectionalIndexType
: ForwardIndexType, _BidirectionalIndexType {}
@transparent public
public
prefix func -- <T: _BidirectionalIndexType> (inout x: T) -> T {
x = x.predecessor()
return x
}
@transparent public
public
postfix func -- <T: _BidirectionalIndexType> (inout x: T) -> T {
var ret = x
x = x.predecessor()
@@ -284,4 +284,3 @@ func ~> <T: _RandomAccessIndexType>(
let d = start.distanceTo(end)
return (n > 0 ? d < n : d > n) ? end : start.advancedBy(n)
}