@@ -52,8 +52,6 @@ class ArgumentSource {
52
52
enum class Kind : unsigned char {
53
53
Invalid,
54
54
RValue,
55
- // An RValue that will be borrowed when emitted.
56
- DelayedBorrowedRValue,
57
55
LValue,
58
56
Expr,
59
57
Tuple,
@@ -91,7 +89,6 @@ class ArgumentSource {
91
89
switch (kind) {
92
90
case Kind::Invalid: return StorageMembers::indexOf<void >();
93
91
case Kind::RValue:
94
- case Kind::DelayedBorrowedRValue:
95
92
return StorageMembers::indexOf<RValueStorage>();
96
93
case Kind::LValue: return StorageMembers::indexOf<LValueStorage>();
97
94
case Kind::Expr: return StorageMembers::indexOf<Expr*>();
@@ -147,7 +144,6 @@ class ArgumentSource {
147
144
case Kind::Invalid:
148
145
return false ;
149
146
case Kind::RValue:
150
- case Kind::DelayedBorrowedRValue:
151
147
return !asKnownRValue ().isNull ();
152
148
case Kind::LValue:
153
149
return asKnownLValue ().isValid ();
@@ -164,7 +160,6 @@ class ArgumentSource {
164
160
case Kind::Invalid:
165
161
llvm_unreachable (" argument source is invalid" );
166
162
case Kind::RValue:
167
- case Kind::DelayedBorrowedRValue:
168
163
return asKnownRValue ().getType ();
169
164
case Kind::LValue:
170
165
return CanInOutType::get (asKnownLValue ().getSubstFormalType ());
@@ -183,7 +178,6 @@ class ArgumentSource {
183
178
case Kind::Invalid:
184
179
llvm_unreachable (" argument source is invalid" );
185
180
case Kind::RValue:
186
- case Kind::DelayedBorrowedRValue:
187
181
return asKnownRValue ().getType ();
188
182
case Kind::LValue:
189
183
return asKnownLValue ().getSubstFormalType ();
@@ -201,7 +195,6 @@ class ArgumentSource {
201
195
switch (StoredKind) {
202
196
case Kind::Invalid: llvm_unreachable (" argument source is invalid" );
203
197
case Kind::RValue:
204
- case Kind::DelayedBorrowedRValue:
205
198
return false ;
206
199
case Kind::LValue: return true ;
207
200
case Kind::Expr: return asKnownExpr ()->isSemanticallyInOutExpr ();
@@ -215,7 +208,6 @@ class ArgumentSource {
215
208
case Kind::Invalid:
216
209
llvm_unreachable (" argument source is invalid" );
217
210
case Kind::RValue:
218
- case Kind::DelayedBorrowedRValue:
219
211
return getKnownRValueLocation ();
220
212
case Kind::LValue:
221
213
return getKnownLValueLocation ();
@@ -228,21 +220,13 @@ class ArgumentSource {
228
220
}
229
221
230
222
bool isExpr () const & { return StoredKind == Kind::Expr; }
231
- bool isRValue () const & {
232
- return StoredKind == Kind::RValue ||
233
- StoredKind == Kind::DelayedBorrowedRValue;
234
- }
223
+ bool isRValue () const & { return StoredKind == Kind::RValue; }
235
224
bool isLValue () const & { return StoredKind == Kind::LValue; }
236
225
bool isTuple () const & { return StoredKind == Kind::Tuple; }
237
226
238
227
// / Given that this source is storing an RValue, extract and clear
239
228
// / that value.
240
229
RValue &&asKnownRValue(SILGenFunction &SGF) && {
241
- if (isDelayedBorrowedRValue ()) {
242
- std::move (Storage.get <RValueStorage>(StoredKind).Value )
243
- .borrow (SGF, getKnownRValueLocation ());
244
- }
245
-
246
230
return std::move (Storage.get <RValueStorage>(StoredKind).Value );
247
231
}
248
232
@@ -313,15 +297,6 @@ class ArgumentSource {
313
297
// / return the ArgumentSource. Otherwise, assert.
314
298
ArgumentSource borrow (SILGenFunction &SGF) const &;
315
299
316
- // / If we have an rvalue, return an Argument Source that when the RValue is
317
- // / retrieved, the RValue is always borrowed first.
318
- // /
319
- // / This allows us to specify when creating callees that a value must be
320
- // / borrowed, but emit the actual borrow once the callee is evaluated later in
321
- // / SILGenApply. Ideally, the callee would always eagerly borrow, but since we
322
- // / still have uncurrying, we can not do that.
323
- ArgumentSource delayedBorrow (SILGenFunction &SGF) const &;
324
-
325
300
ManagedValue materialize (SILGenFunction &SGF) &&;
326
301
327
302
// / Emit this value to memory so that it follows the abstraction
@@ -346,14 +321,6 @@ class ArgumentSource {
346
321
// / Private helper constructor for delayed borrowed rvalues.
347
322
ArgumentSource (SILLocation loc, RValue &&rv, Kind kind);
348
323
349
- // / Returns true if this ArgumentSource stores a delayed borrowed RValue.
350
- // /
351
- // / This is private since we do not want users to be able to determine if the
352
- // / given ArgumentSource is a normal RValue or a delayed borrow rvalue.
353
- bool isDelayedBorrowedRValue () const & {
354
- return StoredKind == Kind::DelayedBorrowedRValue;
355
- }
356
-
357
324
// Make the non-move accessors private to make it more difficult
358
325
// to accidentally re-emit values.
359
326
const RValue &asKnownRValue () const & {
0 commit comments