@@ -197,6 +197,8 @@ struct SILDeclRef {
197197 BackDeploymentKind backDeploymentKind : 2 ;
198198 // / The default argument index for a default argument getter.
199199 unsigned defaultArgIndex : 10 ;
200+ // / Set if this is for an async let closure.
201+ unsigned isAsyncLetClosure : 1 ;
200202
201203 PointerUnion<AutoDiffDerivativeFunctionIdentifier *,
202204 const GenericSignatureImpl *, CustomAttr *>
@@ -229,9 +231,10 @@ struct SILDeclRef {
229231
230232 // / Produces a null SILDeclRef.
231233 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 ) {}
235238
236239 // / Produces a SILDeclRef of the given kind for the given decl.
237240 explicit SILDeclRef (
@@ -397,19 +400,18 @@ struct SILDeclRef {
397400
398401 // / Return the hash code for the SIL declaration.
399402 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 );
404406 }
405407
406408 bool operator ==(SILDeclRef rhs) const {
407409 return loc.getOpaqueValue () == rhs.loc .getOpaqueValue () &&
408410 kind == rhs.kind && isForeign == rhs.isForeign &&
409411 isDistributed == rhs.isDistributed &&
410412 backDeploymentKind == rhs.backDeploymentKind &&
411- defaultArgIndex == rhs.defaultArgIndex &&
412- pointer == rhs.pointer ;
413+ defaultArgIndex == rhs.defaultArgIndex && pointer == rhs. pointer &&
414+ isAsyncLetClosure == rhs.isAsyncLetClosure ;
413415 }
414416 bool operator !=(SILDeclRef rhs) const {
415417 return !(*this == rhs);
@@ -427,20 +429,17 @@ struct SILDeclRef {
427429 /* foreign=*/ foreign,
428430 /* distributed=*/ false ,
429431 /* knownToBeLocal=*/ false ,
430- /* runtimeAccessible=*/ false ,
431- backDeploymentKind,
432- defaultArgIndex,
432+ /* runtimeAccessible=*/ false , backDeploymentKind,
433+ defaultArgIndex, isAsyncLetClosure,
433434 pointer.get <AutoDiffDerivativeFunctionIdentifier *>());
434435 }
435436 // / Returns the distributed entry point corresponding to the same decl.
436437 SILDeclRef asDistributed (bool distributed = true ) const {
437438 return SILDeclRef (loc.getOpaqueValue (), kind,
438439 /* foreign=*/ false ,
439440 /* distributed=*/ distributed,
440- /* knownToBeLocal=*/ false ,
441- isRuntimeAccessible,
442- backDeploymentKind,
443- defaultArgIndex,
441+ /* knownToBeLocal=*/ false , isRuntimeAccessible,
442+ backDeploymentKind, defaultArgIndex, isAsyncLetClosure,
444443 pointer.get <AutoDiffDerivativeFunctionIdentifier *>());
445444 }
446445
@@ -451,9 +450,8 @@ struct SILDeclRef {
451450 /* foreign=*/ false ,
452451 /* distributed=*/ false ,
453452 /* distributedKnownToBeLocal=*/ isLocal,
454- isRuntimeAccessible,
455- backDeploymentKind,
456- defaultArgIndex,
453+ isRuntimeAccessible, backDeploymentKind, defaultArgIndex,
454+ isAsyncLetClosure,
457455 pointer.get <AutoDiffDerivativeFunctionIdentifier *>());
458456 }
459457
@@ -466,13 +464,9 @@ struct SILDeclRef {
466464
467465 // / Returns a copy of the decl with the given back deployment kind.
468466 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,
476470 pointer.get <AutoDiffDerivativeFunctionIdentifier *>());
477471 }
478472
@@ -606,21 +600,18 @@ struct SILDeclRef {
606600private:
607601 friend struct llvm ::DenseMapInfo<swift::SILDeclRef>;
608602 // / 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,
613605 bool isRuntimeAccessible,
614606 BackDeploymentKind backDeploymentKind,
615- unsigned defaultArgIndex,
607+ unsigned defaultArgIndex, bool isAsyncLetClosure,
616608 AutoDiffDerivativeFunctionIdentifier *derivativeId)
617609 : loc(Loc::getFromOpaqueValue(opaqueLoc)), kind(kind),
618- isForeign(isForeign),
619- isDistributed(isDistributed),
610+ isForeign(isForeign), isDistributed(isDistributed),
620611 isKnownToBeLocal(isKnownToBeLocal),
621612 isRuntimeAccessible(isRuntimeAccessible),
622613 backDeploymentKind(backDeploymentKind),
623- defaultArgIndex(defaultArgIndex),
614+ defaultArgIndex(defaultArgIndex), isAsyncLetClosure(isAsyncLetClosure),
624615 pointer(derivativeId) {}
625616};
626617
@@ -644,11 +635,13 @@ template<> struct DenseMapInfo<swift::SILDeclRef> {
644635
645636 static SILDeclRef getEmptyKey () {
646637 return SILDeclRef (PointerInfo::getEmptyKey (), Kind::Func, false , false ,
647- false , false , BackDeploymentKind::None, 0 , nullptr );
638+ false , false , BackDeploymentKind::None, 0 , false ,
639+ nullptr );
648640 }
649641 static SILDeclRef getTombstoneKey () {
650642 return SILDeclRef (PointerInfo::getTombstoneKey (), Kind::Func, false , false ,
651- false , false , BackDeploymentKind::None, 0 , nullptr );
643+ false , false , BackDeploymentKind::None, 0 , false ,
644+ nullptr );
652645 }
653646 static unsigned getHashValue (swift::SILDeclRef Val) {
654647 unsigned h1 = PointerInfo::getHashValue (Val.loc .getOpaqueValue ());
0 commit comments