@@ -168,8 +168,9 @@ class DeclAttribute : public AttributeBase {
168168 );
169169
170170 SWIFT_INLINE_BITFIELD (SynthesizedProtocolAttr, DeclAttribute,
171- NumKnownProtocolKindBits,
172- kind : NumKnownProtocolKindBits
171+ NumKnownProtocolKindBits+1 ,
172+ kind : NumKnownProtocolKindBits,
173+ isUnchecked : 1
173174 );
174175 } Bits;
175176
@@ -288,6 +289,9 @@ class DeclAttribute : public AttributeBase {
288289
289290 // / Whether this attribute is only valid when distributed is enabled.
290291 DistributedOnly = 1ull << (unsigned (DeclKindIndex::Last_Decl) + 17 ),
292+
293+ // / Whether this attribute is valid on additional decls in ClangImporter.
294+ OnAnyClangDecl = 1ull << (unsigned (DeclKindIndex::Last_Decl) + 18 ),
291295 };
292296
293297 LLVM_READNONE
@@ -1276,11 +1280,13 @@ class SynthesizedProtocolAttr : public DeclAttribute {
12761280
12771281public:
12781282 SynthesizedProtocolAttr (KnownProtocolKind protocolKind,
1279- LazyConformanceLoader *Loader)
1283+ LazyConformanceLoader *Loader,
1284+ bool isUnchecked)
12801285 : DeclAttribute(DAK_SynthesizedProtocol, SourceLoc(), SourceRange(),
12811286 /* Implicit=*/ true ), Loader(Loader)
12821287 {
12831288 Bits.SynthesizedProtocolAttr .kind = unsigned (protocolKind);
1289+ Bits.SynthesizedProtocolAttr .isUnchecked = unsigned (isUnchecked);
12841290 }
12851291
12861292 // / Retrieve the known protocol kind naming the protocol to be
@@ -1289,6 +1295,10 @@ class SynthesizedProtocolAttr : public DeclAttribute {
12891295 return KnownProtocolKind (Bits.SynthesizedProtocolAttr .kind );
12901296 }
12911297
1298+ bool isUnchecked () const {
1299+ return bool (Bits.SynthesizedProtocolAttr .isUnchecked );
1300+ }
1301+
12921302 // / Retrieve the lazy loader that will be used to populate the
12931303 // / synthesized conformance.
12941304 LazyConformanceLoader *getLazyLoader () const { return Loader; }
@@ -2217,6 +2227,15 @@ class DeclAttributes {
22172227 return nullptr ;
22182228 }
22192229
2230+ // / Returns the "winning" \c NonSendableAttr or \c SendableAttr in this
2231+ // / attribute list, or \c nullptr if there are none.
2232+ const DeclAttribute *getEffectiveSendableAttr () const ;
2233+
2234+ DeclAttribute *getEffectiveSendableAttr () {
2235+ return const_cast <DeclAttribute *>(
2236+ const_cast <const DeclAttributes *>(this )->getEffectiveSendableAttr ());
2237+ }
2238+
22202239private:
22212240 // / Predicate used to filter MatchingAttributeRange.
22222241 template <typename ATTR, bool AllowInvalid> struct ToAttributeKind {
0 commit comments