@@ -168,8 +168,9 @@ class DeclAttribute : public AttributeBase {
168
168
);
169
169
170
170
SWIFT_INLINE_BITFIELD (SynthesizedProtocolAttr, DeclAttribute,
171
- NumKnownProtocolKindBits,
172
- kind : NumKnownProtocolKindBits
171
+ NumKnownProtocolKindBits+1 ,
172
+ kind : NumKnownProtocolKindBits,
173
+ isUnchecked : 1
173
174
);
174
175
} Bits;
175
176
@@ -288,6 +289,9 @@ class DeclAttribute : public AttributeBase {
288
289
289
290
// / Whether this attribute is only valid when distributed is enabled.
290
291
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 ),
291
295
};
292
296
293
297
LLVM_READNONE
@@ -1276,11 +1280,13 @@ class SynthesizedProtocolAttr : public DeclAttribute {
1276
1280
1277
1281
public:
1278
1282
SynthesizedProtocolAttr (KnownProtocolKind protocolKind,
1279
- LazyConformanceLoader *Loader)
1283
+ LazyConformanceLoader *Loader,
1284
+ bool isUnchecked)
1280
1285
: DeclAttribute(DAK_SynthesizedProtocol, SourceLoc(), SourceRange(),
1281
1286
/* Implicit=*/ true ), Loader(Loader)
1282
1287
{
1283
1288
Bits.SynthesizedProtocolAttr .kind = unsigned (protocolKind);
1289
+ Bits.SynthesizedProtocolAttr .isUnchecked = unsigned (isUnchecked);
1284
1290
}
1285
1291
1286
1292
// / Retrieve the known protocol kind naming the protocol to be
@@ -1289,6 +1295,10 @@ class SynthesizedProtocolAttr : public DeclAttribute {
1289
1295
return KnownProtocolKind (Bits.SynthesizedProtocolAttr .kind );
1290
1296
}
1291
1297
1298
+ bool isUnchecked () const {
1299
+ return bool (Bits.SynthesizedProtocolAttr .isUnchecked );
1300
+ }
1301
+
1292
1302
// / Retrieve the lazy loader that will be used to populate the
1293
1303
// / synthesized conformance.
1294
1304
LazyConformanceLoader *getLazyLoader () const { return Loader; }
@@ -2217,6 +2227,15 @@ class DeclAttributes {
2217
2227
return nullptr ;
2218
2228
}
2219
2229
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
+
2220
2239
private:
2221
2240
// / Predicate used to filter MatchingAttributeRange.
2222
2241
template <typename ATTR, bool AllowInvalid> struct ToAttributeKind {
0 commit comments