@@ -444,11 +444,11 @@ class NormalProtocolConformance : public RootProtocolConformance,
444444
445445 // Flag bits used in ContextAndBits.
446446 enum {
447- // / The conformance is invalid.
448- InvalidFlag = 0x01 ,
449-
450447 // / The conformance was labeled with @unchecked.
451- UncheckedFlag = 0x02 ,
448+ UncheckedFlag = 0x01 ,
449+
450+ // / The conformance was labeled with @preconcurrency.
451+ PreconcurrencyFlag = 0x02 ,
452452
453453 // / We have allocated the AssociatedConformances array (but not necessarily
454454 // / populated any of its elements).
@@ -458,10 +458,13 @@ class NormalProtocolConformance : public RootProtocolConformance,
458458 // / The declaration context containing the ExtensionDecl or
459459 // / NominalTypeDecl that declared the conformance.
460460 // /
461- // / Also stores the "invalid ", "unchecked " and "has computed associated
461+ // / Also stores the "unchecked ", "preconcurrency " and "has computed associated
462462 // / conformances" bits.
463463 llvm::PointerIntPair<DeclContext *, 3 , unsigned > ContextAndBits;
464464
465+ // / Indicates whether the conformance is invalid.
466+ bool Invalid : 1 ;
467+
465468 // / The reason that this conformance exists.
466469 // /
467470 // / Either Explicit (e.g. 'struct Foo: Protocol {}' or 'extension Foo:
@@ -501,12 +504,14 @@ class NormalProtocolConformance : public RootProtocolConformance,
501504public:
502505 NormalProtocolConformance (Type conformingType, ProtocolDecl *protocol,
503506 SourceLoc loc, DeclContext *dc,
504- ProtocolConformanceState state,
505- bool isUnchecked )
507+ ProtocolConformanceState state, bool isUnchecked,
508+ bool isPreconcurrency )
506509 : RootProtocolConformance(ProtocolConformanceKind::Normal,
507510 conformingType),
508511 ProtocolAndState (protocol, state), Loc(loc),
509- ContextAndBits(dc, isUnchecked ? UncheckedFlag : 0 ) {
512+ ContextAndBits(dc, ((isUnchecked ? UncheckedFlag : 0 ) |
513+ (isPreconcurrency ? PreconcurrencyFlag : 0 ))),
514+ Invalid(false ) {
510515 assert (!conformingType->hasArchetype () &&
511516 " ProtocolConformances should store interface types" );
512517 }
@@ -543,12 +548,12 @@ class NormalProtocolConformance : public RootProtocolConformance,
543548
544549 // / Determine whether this conformance is invalid.
545550 bool isInvalid () const {
546- return ContextAndBits. getInt () & InvalidFlag ;
551+ return Invalid ;
547552 }
548553
549554 // / Mark this conformance as invalid.
550555 void setInvalid () {
551- ContextAndBits. setInt (ContextAndBits. getInt () | InvalidFlag) ;
556+ Invalid = true ;
552557 }
553558
554559 // / Whether this is an "unchecked" conformance.
@@ -563,6 +568,9 @@ class NormalProtocolConformance : public RootProtocolConformance,
563568 ContextAndBits.setInt (ContextAndBits.getInt () | UncheckedFlag);
564569 }
565570
571+ // / Whether this is an preconcurrency conformance.
572+ bool isPreconcurrency () const ;
573+
566574 // / Determine whether we've lazily computed the associated conformance array
567575 // / already.
568576 bool hasComputedAssociatedConformances () const {
0 commit comments