Skip to content

Commit c3a9daa

Browse files
committed
@dependsOn -> dependsOn
1 parent 22b68c7 commit c3a9daa

24 files changed

+126
-129
lines changed

include/swift/AST/LifetimeDependence.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -119,11 +119,11 @@ class LifetimeDependenceSpecifier {
119119
std::string getLifetimeDependenceSpecifierString() const {
120120
switch (parsedLifetimeDependenceKind) {
121121
case ParsedLifetimeDependenceKind::Default:
122-
return "@dependsOn(" + getParamString() + ")";
122+
return "dependsOn(" + getParamString() + ")";
123123
case ParsedLifetimeDependenceKind::Scope:
124-
return "@dependsOn(scoped " + getParamString() + ")";
124+
return "dependsOn(scoped " + getParamString() + ")";
125125
case ParsedLifetimeDependenceKind::Inherit:
126-
return "@dependsOn(inherited " + getParamString() + ")";
126+
return "dependsOn(inherited " + getParamString() + ")";
127127
}
128128
llvm_unreachable(
129129
"Invalid LifetimeDependenceSpecifier::ParsedLifetimeDependenceKind");

include/swift/Parse/Parser.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1226,8 +1226,7 @@ class Parser {
12261226

12271227
bool isLifetimeDependenceToken() {
12281228
if (!isInSILMode()) {
1229-
return Tok.is(tok::at_sign) &&
1230-
peekToken().isContextualKeyword("dependsOn");
1229+
return Tok.isContextualKeyword("dependsOn");
12311230
}
12321231
return Tok.isContextualKeyword("_inherit") ||
12331232
Tok.isContextualKeyword("_scope");

lib/Parse/ParseDecl.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5077,8 +5077,6 @@ ParserStatus Parser::parseLifetimeDependenceSpecifiers(
50775077
auto lifetimeDependenceKind = ParsedLifetimeDependenceKind::Default;
50785078

50795079
if (!isInSILMode()) {
5080-
// consume @
5081-
consumeToken();
50825080
// consume dependsOn
50835081
consumeToken();
50845082
} else {

test/ModuleInterface/Inputs/lifetime_dependence.swift

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,32 +19,32 @@ public struct BufferView : ~Escapable {
1919
}
2020

2121
@inlinable
22-
internal init(_ ptr: UnsafeRawBufferPointer, _ a: borrowing Array<Int>) -> @dependsOn(a) Self {
22+
internal init(_ ptr: UnsafeRawBufferPointer, _ a: borrowing Array<Int>) -> dependsOn(a) Self {
2323
self.init(ptr, a.count)
2424
return self
2525
}
2626
@inlinable
27-
internal init(_ ptr: UnsafeRawBufferPointer, _ a: consuming AnotherView) -> @dependsOn(a) Self {
27+
internal init(_ ptr: UnsafeRawBufferPointer, _ a: consuming AnotherView) -> dependsOn(a) Self {
2828
self.init(ptr, a._count)
2929
return self
3030
}
3131
}
3232

3333
@inlinable
34-
public func derive(_ x: consuming BufferView) -> @dependsOn(x) BufferView {
34+
public func derive(_ x: consuming BufferView) -> dependsOn(x) BufferView {
3535
return BufferView(x._ptr, x._count)
3636
}
3737

3838
@inlinable
3939
public func use(_ x: consuming BufferView) {}
4040

4141
@inlinable
42-
public func consumeAndCreate(_ view: consuming BufferView) -> @dependsOn(view) BufferView {
42+
public func consumeAndCreate(_ view: consuming BufferView) -> dependsOn(view) BufferView {
4343
return BufferView(view._ptr, view._count)
4444
}
4545

4646
@inlinable
47-
public func deriveThisOrThat(_ this: consuming BufferView, _ that: consuming BufferView) -> @dependsOn(this, that) BufferView {
47+
public func deriveThisOrThat(_ this: consuming BufferView, _ that: consuming BufferView) -> dependsOn(this, that) BufferView {
4848
if (Int.random(in: 1..<100) == 0) {
4949
return BufferView(this._ptr, this._count)
5050
}

test/ModuleInterface/lifetime_dependence_test.swift

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,18 +29,18 @@
2929
import lifetime_dependence
3030

3131
// CHECK: #if compiler(>=5.3) && $NoncopyableGenerics
32-
// CHECK: @inlinable internal init(_ ptr: Swift.UnsafeRawBufferPointer, _ a: borrowing Swift.Array<Swift.Int>) -> @dependsOn(a) Self {
33-
// CHECK: @inlinable internal init(_ ptr: Swift.UnsafeRawBufferPointer, _ a: consuming lifetime_dependence.AnotherView) -> @dependsOn(a) Self {
32+
// CHECK: @inlinable internal init(_ ptr: Swift.UnsafeRawBufferPointer, _ a: borrowing Swift.Array<Swift.Int>) -> dependsOn(a) Self {
33+
// CHECK: @inlinable internal init(_ ptr: Swift.UnsafeRawBufferPointer, _ a: consuming lifetime_dependence.AnotherView) -> dependsOn(a) Self {
3434
// CHECK: #endif
3535

3636
// CHECK: #if compiler(>=5.3) && $NoncopyableGenerics
37-
// CHECK: @inlinable public func derive(_ x: consuming lifetime_dependence.BufferView) -> @dependsOn(x) lifetime_dependence.BufferView {
37+
// CHECK: @inlinable public func derive(_ x: consuming lifetime_dependence.BufferView) -> dependsOn(x) lifetime_dependence.BufferView {
3838
// CHECK: #endif
3939

4040
// CHECK: #if compiler(>=5.3) && $NoncopyableGenerics
41-
// CHECK: @inlinable public func consumeAndCreate(_ view: consuming lifetime_dependence.BufferView) -> @dependsOn(view) lifetime_dependence.BufferView {
41+
// CHECK: @inlinable public func consumeAndCreate(_ view: consuming lifetime_dependence.BufferView) -> dependsOn(view) lifetime_dependence.BufferView {
4242
// CHECK: #endif
4343

4444
// CHECK: #if compiler(>=5.3) && $NoncopyableGenerics
45-
// CHECK: @inlinable public func deriveThisOrThat(_ this: consuming lifetime_dependence.BufferView, _ that: consuming lifetime_dependence.BufferView) -> @dependsOn(this) @dependsOn(that) lifetime_dependence.BufferView {
45+
// CHECK: @inlinable public func deriveThisOrThat(_ this: consuming lifetime_dependence.BufferView, _ that: consuming lifetime_dependence.BufferView) -> dependsOn(this) dependsOn(that) lifetime_dependence.BufferView {
4646
// CHECK: #endif

test/Parse/explicit_lifetime_dependence_specifiers.swift

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -16,24 +16,24 @@ struct BufferView : ~Escapable {
1616
}
1717
self.ptr = ptr
1818
}
19-
init(_ ptr: UnsafeRawBufferPointer, _ a: borrowing Array<Int>) -> @dependsOn(a) Self {
19+
init(_ ptr: UnsafeRawBufferPointer, _ a: borrowing Array<Int>) -> dependsOn(a) Self {
2020
self.ptr = ptr
2121
return self
2222
}
23-
init(_ ptr: UnsafeRawBufferPointer, _ a: consuming Wrapper) -> @dependsOn(a) Self {
23+
init(_ ptr: UnsafeRawBufferPointer, _ a: consuming Wrapper) -> dependsOn(a) Self {
2424
self.ptr = ptr
2525
return self
2626
}
27-
init(_ ptr: UnsafeRawBufferPointer, _ a: consuming Wrapper, b: borrowing Array<Int>) -> @dependsOn(a) @dependsOn(b) Self {
27+
init(_ ptr: UnsafeRawBufferPointer, _ a: consuming Wrapper, b: borrowing Array<Int>) -> dependsOn(a) dependsOn(b) Self {
2828
self.ptr = ptr
2929
return self
3030
}
31-
init(_ ptr: UnsafeRawBufferPointer, _ a: borrowing Array<Double>, b: borrowing Array<Int>, c: Double) -> @dependsOn(a) @dependsOn(b) Int { // expected-error{{expected Self return type for initializers with lifetime dependence specifiers}}
31+
init(_ ptr: UnsafeRawBufferPointer, _ a: borrowing Array<Double>, b: borrowing Array<Int>, c: Double) -> dependsOn(a) dependsOn(b) Int { // expected-error{{expected Self return type for initializers with lifetime dependence specifiers}}
3232
self.ptr = ptr
3333
return 0
3434
}
3535
/* TODO: Enable this test once stdlib builds with NonescapableTypes support
36-
init?(_ ptr: UnsafeRawBufferPointer, _ a: borrowing Array<Int>, _ i: Int) -> @dependsOn(a) Self {
36+
init?(_ ptr: UnsafeRawBufferPointer, _ a: borrowing Array<Int>, _ i: Int) -> dependsOn(a) Self {
3737
if (i % 2 == 0) {
3838
self.ptr = ptr
3939
return self
@@ -62,95 +62,95 @@ func testBasic() {
6262
}
6363
}
6464

65-
func derive(_ x: borrowing BufferView) -> @dependsOn(x) BufferView {
65+
func derive(_ x: borrowing BufferView) -> dependsOn(x) BufferView {
6666
return BufferView(x.ptr)
6767
}
6868

69-
func consumeAndCreate(_ x: consuming BufferView) -> @dependsOn(x) BufferView {
69+
func consumeAndCreate(_ x: consuming BufferView) -> dependsOn(x) BufferView {
7070
return BufferView(x.ptr)
7171
}
7272

7373
func use(_ x: borrowing BufferView) {}
7474

75-
func deriveMultiView1(_ x: borrowing BufferView, _ y: borrowing BufferView) -> @dependsOn(x, y) BufferView {
75+
func deriveMultiView1(_ x: borrowing BufferView, _ y: borrowing BufferView) -> dependsOn(x, y) BufferView {
7676
if (Int.random(in: 1..<100) % 2 == 0) {
7777
return BufferView(x.ptr)
7878
}
7979
return BufferView(y.ptr)
8080
}
8181

82-
func deriveMultiView2(_ x: borrowing BufferView, _ y: borrowing BufferView) -> @dependsOn(x) @dependsOn(y) BufferView {
82+
func deriveMultiView2(_ x: borrowing BufferView, _ y: borrowing BufferView) -> dependsOn(x) dependsOn(y) BufferView {
8383
if (Int.random(in: 1..<100) % 2 == 0) {
8484
return BufferView(x.ptr)
8585
}
8686
return BufferView(y.ptr)
8787
}
8888

89-
func consumeAndCreateMultiView1(_ x: consuming BufferView, _ y: consuming BufferView) -> @dependsOn(x, y) BufferView {
89+
func consumeAndCreateMultiView1(_ x: consuming BufferView, _ y: consuming BufferView) -> dependsOn(x, y) BufferView {
9090
if (Int.random(in: 1..<100) % 2 == 0) {
9191
return BufferView(x.ptr)
9292
}
9393
return BufferView(y.ptr)
9494
}
9595

96-
func consumeAndCreateMultiView2(_ x: consuming BufferView, _ y: consuming BufferView) -> @dependsOn(x) @dependsOn(y) BufferView {
96+
func consumeAndCreateMultiView2(_ x: consuming BufferView, _ y: consuming BufferView) -> dependsOn(x) dependsOn(y) BufferView {
9797
if (Int.random(in: 1..<100) % 2 == 0) {
9898
return BufferView(x.ptr)
9999
}
100100
return BufferView(y.ptr)
101101
}
102102

103-
func mixedMultiView(_ x: consuming BufferView, _ y: borrowing BufferView) -> @dependsOn(x) @dependsOn(y) BufferView {
103+
func mixedMultiView(_ x: consuming BufferView, _ y: borrowing BufferView) -> dependsOn(x) dependsOn(y) BufferView {
104104
if (Int.random(in: 1..<100) % 2 == 0) {
105105
return BufferView(x.ptr)
106106
}
107107
return BufferView(y.ptr)
108108
}
109109

110-
func modifiedViewDependsOnInput(_ x: inout MutableBufferView) -> @dependsOn(x) MutableBufferView {
110+
func modifiedViewDependsOnInput(_ x: inout MutableBufferView) -> dependsOn(x) MutableBufferView {
111111
return MutableBufferView(x.ptr)
112112
}
113113

114-
func modifiedViewDependsOnParent(_ x: inout MutableBufferView) -> @dependsOn(x) MutableBufferView {
114+
func modifiedViewDependsOnParent(_ x: inout MutableBufferView) -> dependsOn(x) MutableBufferView {
115115
return MutableBufferView(x.ptr)
116116
}
117117

118-
func invalidSpecifier1(_ x: borrowing BufferView) -> @dependsOn BufferView { // expected-error{{expected '(' after lifetime dependence specifier}}
118+
func invalidSpecifier1(_ x: borrowing BufferView) -> dependsOn BufferView { // expected-error{{expected '(' after lifetime dependence specifier}}
119119
return BufferView(x.ptr)
120120
}
121121

122-
func invalidSpecifier2(_ x: borrowing BufferView) -> @dependsOn() BufferView {// expected-error{{expected identifier, index or self in lifetime dependence specifier}}
122+
func invalidSpecifier2(_ x: borrowing BufferView) -> dependsOn() BufferView {// expected-error{{expected identifier, index or self in lifetime dependence specifier}}
123123
return BufferView(x.ptr)
124124
}
125125

126-
func invalidSpecifier3(_ x: borrowing BufferView) -> @dependsOn(*) BufferView { // expected-error{{expected identifier, index or self in lifetime dependence specifier}}
126+
func invalidSpecifier3(_ x: borrowing BufferView) -> dependsOn(*) BufferView { // expected-error{{expected identifier, index or self in lifetime dependence specifier}}
127127
return BufferView(x.ptr)
128128
}
129129

130130
// TODO: Diagnose using param indices on func decls in sema
131-
func invalidSpecifier4(_ x: borrowing BufferView) -> @dependsOn(0) BufferView { // expected-error{{invalid lifetime dependence specifier on non-existent self}}
131+
func invalidSpecifier4(_ x: borrowing BufferView) -> dependsOn(0) BufferView { // expected-error{{invalid lifetime dependence specifier on non-existent self}}
132132
return BufferView(x.ptr)
133133
}
134134

135135
struct Wrapper : ~Escapable {
136136
let view: BufferView
137-
init(_ view: consuming BufferView) -> @dependsOn(view) Self {
137+
init(_ view: consuming BufferView) -> dependsOn(view) Self {
138138
self.view = view
139139
return self
140140
}
141-
borrowing func getView1() -> @dependsOn(self) BufferView {
141+
borrowing func getView1() -> dependsOn(self) BufferView {
142142
return view
143143
}
144144

145-
consuming func getView2() -> @dependsOn(self) BufferView {
145+
consuming func getView2() -> dependsOn(self) BufferView {
146146
return view
147147
}
148148

149-
mutating func getView3() -> @dependsOn(self) BufferView {
149+
mutating func getView3() -> dependsOn(self) BufferView {
150150
return view
151151
}
152152

153-
borrowing func getView4() -> @dependsOn(self) BufferView {
153+
borrowing func getView4() -> dependsOn(self) BufferView {
154154
return view
155155
}
156156
}

test/SIL/explicit_lifetime_dependence_specifiers.swift

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -22,17 +22,17 @@ struct BufferView : ~Escapable {
2222
self.ptr = ptr
2323
}
2424
// CHECK: sil hidden @$s39explicit_lifetime_dependence_specifiers10BufferViewVyACSW_SaySiGhYlstcfC : $@convention(method) (UnsafeRawBufferPointer, @guaranteed Array<Int>, @thin BufferView.Type) -> _scope(2) @owned BufferView {
25-
init(_ ptr: UnsafeRawBufferPointer, _ a: borrowing Array<Int>) -> @dependsOn(a) Self {
25+
init(_ ptr: UnsafeRawBufferPointer, _ a: borrowing Array<Int>) -> dependsOn(a) Self {
2626
self.ptr = ptr
2727
return self
2828
}
2929
// CHECK: sil hidden @$s39explicit_lifetime_dependence_specifiers10BufferViewVyACSW_AA7WrapperVYlitcfC : $@convention(method) (UnsafeRawBufferPointer, @owned Wrapper, @thin BufferView.Type) -> _inherit(2) @owned BufferView {
30-
init(_ ptr: UnsafeRawBufferPointer, _ a: consuming Wrapper) -> @dependsOn(a) Self {
30+
init(_ ptr: UnsafeRawBufferPointer, _ a: consuming Wrapper) -> dependsOn(a) Self {
3131
self.ptr = ptr
3232
return self
3333
}
3434
// CHECK: sil hidden @$s39explicit_lifetime_dependence_specifiers10BufferViewVyACSW_AA7WrapperVYliSaySiGhYlstcfC : $@convention(method) (UnsafeRawBufferPointer, @owned Wrapper, @guaranteed Array<Int>, @thin BufferView.Type) -> _inherit(2) _scope(3) @owned BufferView {
35-
init(_ ptr: UnsafeRawBufferPointer, _ a: consuming Wrapper, _ b: borrowing Array<Int>) -> @dependsOn(a) @dependsOn(b) Self {
35+
init(_ ptr: UnsafeRawBufferPointer, _ a: consuming Wrapper, _ b: borrowing Array<Int>) -> dependsOn(a) dependsOn(b) Self {
3636
self.ptr = ptr
3737
return self
3838
}
@@ -58,25 +58,25 @@ func testBasic() {
5858
}
5959

6060
// CHECK: sil hidden @$s39explicit_lifetime_dependence_specifiers6deriveyAA10BufferViewVADYlsF : $@convention(thin) (@guaranteed BufferView) -> _scope(1) @owned BufferView {
61-
func derive(_ x: borrowing BufferView) -> @dependsOn(scoped x) BufferView {
61+
func derive(_ x: borrowing BufferView) -> dependsOn(scoped x) BufferView {
6262
return BufferView(x.ptr)
6363
}
6464

6565
// CHECK: sil hidden @$s39explicit_lifetime_dependence_specifiers16consumeAndCreateyAA10BufferViewVADnYliF : $@convention(thin) (@owned BufferView) -> _inherit(1) @owned BufferView {
66-
func consumeAndCreate(_ x: consuming BufferView) -> @dependsOn(x) BufferView {
66+
func consumeAndCreate(_ x: consuming BufferView) -> dependsOn(x) BufferView {
6767
return BufferView(x.ptr)
6868
}
6969

7070
// CHECK: sil hidden @$s39explicit_lifetime_dependence_specifiers17deriveThisOrThat1yAA10BufferViewVADYls_ADYlstF : $@convention(thin) (@guaranteed BufferView, @guaranteed BufferView) -> _scope(1, 2) @owned BufferView {
71-
func deriveThisOrThat1(_ this: borrowing BufferView, _ that: borrowing BufferView) -> @dependsOn(scoped this, that) BufferView {
71+
func deriveThisOrThat1(_ this: borrowing BufferView, _ that: borrowing BufferView) -> dependsOn(scoped this, that) BufferView {
7272
if (Int.random(in: 1..<100) == 0) {
7373
return BufferView(this.ptr)
7474
}
7575
return BufferView(that.ptr)
7676
}
7777

7878
// CHECK: sil hidden @$s39explicit_lifetime_dependence_specifiers17deriveThisOrThat2yAA10BufferViewVADYls_ADnYlitF : $@convention(thin) (@guaranteed BufferView, @owned BufferView) -> _inherit(2) _scope(1) @owned BufferView {
79-
func deriveThisOrThat2(_ this: borrowing BufferView, _ that: consuming BufferView) -> @dependsOn(scoped this) @dependsOn(that) BufferView {
79+
func deriveThisOrThat2(_ this: borrowing BufferView, _ that: consuming BufferView) -> dependsOn(scoped this) dependsOn(that) BufferView {
8080
if (Int.random(in: 1..<100) == 0) {
8181
return BufferView(this.ptr)
8282
}
@@ -91,12 +91,12 @@ struct Wrapper : ~Escapable {
9191
self.view = view
9292
}
9393
// CHECK: sil hidden @$s39explicit_lifetime_dependence_specifiers7WrapperV8getView1AA10BufferViewVyYLsF : $@convention(method) (@guaranteed Wrapper) -> _scope(0) @owned BufferView {
94-
borrowing func getView1() -> @dependsOn(scoped self) BufferView {
94+
borrowing func getView1() -> dependsOn(scoped self) BufferView {
9595
return view
9696
}
9797

9898
// CHECK: sil hidden @$s39explicit_lifetime_dependence_specifiers7WrapperV8getView2AA10BufferViewVyYLiF : $@convention(method) (@owned Wrapper) -> _inherit(0) @owned BufferView {
99-
consuming func getView2() -> @dependsOn(self) BufferView {
99+
consuming func getView2() -> dependsOn(self) BufferView {
100100
return view
101101
}
102102
}
@@ -110,12 +110,12 @@ struct Container : ~Escapable {
110110
}
111111

112112
// CHECK-LABEL: sil hidden @$s39explicit_lifetime_dependence_specifiers16getConsumingViewyAA06BufferG0VAA9ContainerVnYliF : $@convention(thin) (@owned Container) -> _inherit(1) @owned BufferView {
113-
func getConsumingView(_ x: consuming Container) -> @dependsOn(x) BufferView {
113+
func getConsumingView(_ x: consuming Container) -> dependsOn(x) BufferView {
114114
return BufferView(x.ptr)
115115
}
116116

117117
// CHECK-LABEL: sil hidden @$s39explicit_lifetime_dependence_specifiers16getBorrowingViewyAA06BufferG0VAA9ContainerVYlsF : $@convention(thin) (@guaranteed Container) -> _scope(1) @owned BufferView {
118-
func getBorrowingView(_ x: borrowing Container) -> @dependsOn(scoped x) BufferView {
118+
func getBorrowingView(_ x: borrowing Container) -> dependsOn(scoped x) BufferView {
119119
return BufferView(x.ptr)
120120
}
121121

test/SIL/lifetime_dependence_buffer_view_test.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -135,18 +135,18 @@ extension BufferView {
135135
}
136136
}
137137

138-
borrowing public func prefix(upTo index: BufferViewIndex<Element>) -> @dependsOn(self) Self {
138+
borrowing public func prefix(upTo index: BufferViewIndex<Element>) -> dependsOn(self) Self {
139139
index == startIndex
140140
? Self(start: start, count: 0, dependsOn: copy self)
141141
: prefix(through: index.advanced(by: -1))
142142
}
143143

144-
borrowing public func prefix(through index: Index) -> @dependsOn(self) Self {
144+
borrowing public func prefix(through index: Index) -> dependsOn(self) Self {
145145
let nc = distance(from: startIndex, to: index) &+ 1
146146
return Self(start: start, count: nc, dependsOn: copy self)
147147
}
148148

149-
consuming public func prefix(_ maxLength: Int) -> @dependsOn(self) Self {
149+
consuming public func prefix(_ maxLength: Int) -> dependsOn(self) Self {
150150
precondition(maxLength >= 0, "Can't have a prefix of negative length.")
151151
let nc = maxLength < count ? maxLength : count
152152
return Self(start: start, count: nc, dependsOn: self)

test/SIL/lifetime_dependence_generics.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@
66

77
protocol P {
88
associatedtype E: ~Escapable
9-
borrowing func getE() -> @dependsOn(self) E
9+
borrowing func getE() -> dependsOn(self) E
1010
}
1111

1212
extension P {
13-
borrowing func getDefault() -> @dependsOn(self) E {
13+
borrowing func getDefault() -> dependsOn(self) E {
1414
return getE()
1515
}
1616
}
@@ -21,10 +21,10 @@ public struct View: ~Escapable {
2121
}
2222

2323
public struct PView: P {
24-
borrowing func getE() -> @dependsOn(self) View { return View() }
24+
borrowing func getE() -> dependsOn(self) View { return View() }
2525
}
2626

27-
public func test(pview: borrowing PView) -> @dependsOn(pview) View {
27+
public func test(pview: borrowing PView) -> dependsOn(pview) View {
2828
return pview.getDefault()
2929
}
3030

test/SILOptimizer/lifetime_dependence_borrow.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,22 +35,22 @@ struct NCNE : ~Copyable {
3535
}
3636

3737
// Requires a borrow.
38-
borrowing func getBV() -> @dependsOn(self) BV {
38+
borrowing func getBV() -> dependsOn(self) BV {
3939
BV(p, c)
4040
}
4141
}
4242

4343
// Propagate a borrow.
44-
func bv_get_borrow(container: borrowing NCNE) -> @dependsOn(container) BV {
44+
func bv_get_borrow(container: borrowing NCNE) -> dependsOn(container) BV {
4545
container.getBV()
4646
}
4747

4848
// Copy a borrow.
49-
func bv_get_copy(container: borrowing NCNE) -> @dependsOn(container) BV {
49+
func bv_get_copy(container: borrowing NCNE) -> dependsOn(container) BV {
5050
return container.getBV()
5151
}
5252

5353
// Recognize nested accesses as part of the same dependence scope.
54-
func bv_get_mutate(container: inout NCNE) -> @dependsOn(container) BV {
54+
func bv_get_mutate(container: inout NCNE) -> dependsOn(container) BV {
5555
container.getBV()
5656
}

0 commit comments

Comments
 (0)