@@ -197,6 +197,8 @@ struct SILDeclRef {
197
197
BackDeploymentKind backDeploymentKind : 2 ;
198
198
// / The default argument index for a default argument getter.
199
199
unsigned defaultArgIndex : 10 ;
200
+ // / Set if this is for an async let closure.
201
+ unsigned isAsyncLetClosure : 1 ;
200
202
201
203
PointerUnion<AutoDiffDerivativeFunctionIdentifier *,
202
204
const GenericSignatureImpl *, CustomAttr *>
@@ -229,9 +231,10 @@ struct SILDeclRef {
229
231
230
232
// / Produces a null SILDeclRef.
231
233
SILDeclRef ()
232
- : loc(), kind(Kind::Func), isForeign(0 ),
233
- isDistributed (0 ), isKnownToBeLocal(0 ), isRuntimeAccessible(0 ),
234
- backDeploymentKind(BackDeploymentKind::None), defaultArgIndex(0 ) {}
234
+ : loc(), kind(Kind::Func), isForeign(0 ), isDistributed(0 ),
235
+ isKnownToBeLocal (0 ), isRuntimeAccessible(0 ),
236
+ backDeploymentKind(BackDeploymentKind::None), defaultArgIndex(0 ),
237
+ isAsyncLetClosure(0 ) {}
235
238
236
239
// / Produces a SILDeclRef of the given kind for the given decl.
237
240
explicit SILDeclRef (
@@ -397,19 +400,18 @@ struct SILDeclRef {
397
400
398
401
// / Return the hash code for the SIL declaration.
399
402
friend llvm::hash_code hash_value (const SILDeclRef &ref) {
400
- return llvm::hash_combine (ref.loc .getOpaqueValue (),
401
- static_cast <int >(ref.kind ),
402
- ref.isForeign , ref.isDistributed ,
403
- ref.defaultArgIndex );
403
+ return llvm::hash_combine (
404
+ ref.loc .getOpaqueValue (), static_cast <int >(ref.kind ), ref.isForeign ,
405
+ ref.isDistributed , ref.defaultArgIndex , ref.isAsyncLetClosure );
404
406
}
405
407
406
408
bool operator ==(SILDeclRef rhs) const {
407
409
return loc.getOpaqueValue () == rhs.loc .getOpaqueValue () &&
408
410
kind == rhs.kind && isForeign == rhs.isForeign &&
409
411
isDistributed == rhs.isDistributed &&
410
412
backDeploymentKind == rhs.backDeploymentKind &&
411
- defaultArgIndex == rhs.defaultArgIndex &&
412
- pointer == rhs.pointer ;
413
+ defaultArgIndex == rhs.defaultArgIndex && pointer == rhs. pointer &&
414
+ isAsyncLetClosure == rhs.isAsyncLetClosure ;
413
415
}
414
416
bool operator !=(SILDeclRef rhs) const {
415
417
return !(*this == rhs);
@@ -427,20 +429,17 @@ struct SILDeclRef {
427
429
/* foreign=*/ foreign,
428
430
/* distributed=*/ false ,
429
431
/* knownToBeLocal=*/ false ,
430
- /* runtimeAccessible=*/ false ,
431
- backDeploymentKind,
432
- defaultArgIndex,
432
+ /* runtimeAccessible=*/ false , backDeploymentKind,
433
+ defaultArgIndex, isAsyncLetClosure,
433
434
pointer.get <AutoDiffDerivativeFunctionIdentifier *>());
434
435
}
435
436
// / Returns the distributed entry point corresponding to the same decl.
436
437
SILDeclRef asDistributed (bool distributed = true ) const {
437
438
return SILDeclRef (loc.getOpaqueValue (), kind,
438
439
/* foreign=*/ false ,
439
440
/* distributed=*/ distributed,
440
- /* knownToBeLocal=*/ false ,
441
- isRuntimeAccessible,
442
- backDeploymentKind,
443
- defaultArgIndex,
441
+ /* knownToBeLocal=*/ false , isRuntimeAccessible,
442
+ backDeploymentKind, defaultArgIndex, isAsyncLetClosure,
444
443
pointer.get <AutoDiffDerivativeFunctionIdentifier *>());
445
444
}
446
445
@@ -451,9 +450,8 @@ struct SILDeclRef {
451
450
/* foreign=*/ false ,
452
451
/* distributed=*/ false ,
453
452
/* distributedKnownToBeLocal=*/ isLocal,
454
- isRuntimeAccessible,
455
- backDeploymentKind,
456
- defaultArgIndex,
453
+ isRuntimeAccessible, backDeploymentKind, defaultArgIndex,
454
+ isAsyncLetClosure,
457
455
pointer.get <AutoDiffDerivativeFunctionIdentifier *>());
458
456
}
459
457
@@ -466,13 +464,9 @@ struct SILDeclRef {
466
464
467
465
// / Returns a copy of the decl with the given back deployment kind.
468
466
SILDeclRef asBackDeploymentKind (BackDeploymentKind backDeploymentKind) const {
469
- return SILDeclRef (loc.getOpaqueValue (), kind,
470
- isForeign,
471
- isDistributed,
472
- isKnownToBeLocal,
473
- isRuntimeAccessible,
474
- backDeploymentKind,
475
- defaultArgIndex,
467
+ return SILDeclRef (loc.getOpaqueValue (), kind, isForeign, isDistributed,
468
+ isKnownToBeLocal, isRuntimeAccessible, backDeploymentKind,
469
+ defaultArgIndex, isAsyncLetClosure,
476
470
pointer.get <AutoDiffDerivativeFunctionIdentifier *>());
477
471
}
478
472
@@ -606,21 +600,18 @@ struct SILDeclRef {
606
600
private:
607
601
friend struct llvm ::DenseMapInfo<swift::SILDeclRef>;
608
602
// / Produces a SILDeclRef from an opaque value.
609
- explicit SILDeclRef (void *opaqueLoc, Kind kind,
610
- bool isForeign,
611
- bool isDistributed,
612
- bool isKnownToBeLocal,
603
+ explicit SILDeclRef (void *opaqueLoc, Kind kind, bool isForeign,
604
+ bool isDistributed, bool isKnownToBeLocal,
613
605
bool isRuntimeAccessible,
614
606
BackDeploymentKind backDeploymentKind,
615
- unsigned defaultArgIndex,
607
+ unsigned defaultArgIndex, bool isAsyncLetClosure,
616
608
AutoDiffDerivativeFunctionIdentifier *derivativeId)
617
609
: loc(Loc::getFromOpaqueValue(opaqueLoc)), kind(kind),
618
- isForeign(isForeign),
619
- isDistributed(isDistributed),
610
+ isForeign(isForeign), isDistributed(isDistributed),
620
611
isKnownToBeLocal(isKnownToBeLocal),
621
612
isRuntimeAccessible(isRuntimeAccessible),
622
613
backDeploymentKind(backDeploymentKind),
623
- defaultArgIndex(defaultArgIndex),
614
+ defaultArgIndex(defaultArgIndex), isAsyncLetClosure(isAsyncLetClosure),
624
615
pointer(derivativeId) {}
625
616
};
626
617
@@ -644,11 +635,13 @@ template<> struct DenseMapInfo<swift::SILDeclRef> {
644
635
645
636
static SILDeclRef getEmptyKey () {
646
637
return SILDeclRef (PointerInfo::getEmptyKey (), Kind::Func, false , false ,
647
- false , false , BackDeploymentKind::None, 0 , nullptr );
638
+ false , false , BackDeploymentKind::None, 0 , false ,
639
+ nullptr );
648
640
}
649
641
static SILDeclRef getTombstoneKey () {
650
642
return SILDeclRef (PointerInfo::getTombstoneKey (), Kind::Func, false , false ,
651
- false , false , BackDeploymentKind::None, 0 , nullptr );
643
+ false , false , BackDeploymentKind::None, 0 , false ,
644
+ nullptr );
652
645
}
653
646
static unsigned getHashValue (swift::SILDeclRef Val) {
654
647
unsigned h1 = PointerInfo::getHashValue (Val.loc .getOpaqueValue ());
0 commit comments