@@ -530,6 +530,9 @@ class NormalProtocolConformance : public RootProtocolConformance,
530530 // / The location of this protocol conformance in the source.
531531 SourceLoc Loc;
532532
533+ // / The location of the `@preconcurrency` attribute, if any.
534+ SourceLoc PreconcurrencyLoc;
535+
533536 // / The declaration context containing the ExtensionDecl or
534537 // / NominalTypeDecl that declared the conformance.
535538 DeclContext *Context;
@@ -562,10 +565,12 @@ class NormalProtocolConformance : public RootProtocolConformance,
562565 NormalProtocolConformance (Type conformingType, ProtocolDecl *protocol,
563566 SourceLoc loc, DeclContext *dc,
564567 ProtocolConformanceState state, bool isUnchecked,
565- bool isPreconcurrency)
568+ bool isPreconcurrency,
569+ SourceLoc preconcurrencyLoc)
566570 : RootProtocolConformance(ProtocolConformanceKind::Normal,
567571 conformingType),
568- Protocol (protocol), Loc(loc), Context(dc) {
572+ Protocol (protocol), Loc(loc), PreconcurrencyLoc(preconcurrencyLoc),
573+ Context(dc) {
569574 assert (!conformingType->hasArchetype () &&
570575 " ProtocolConformances should store interface types" );
571576 setState (state);
@@ -580,7 +585,7 @@ class NormalProtocolConformance : public RootProtocolConformance,
580585 // / Get the protocol being conformed to.
581586 ProtocolDecl *getProtocol () const { return Protocol; }
582587
583- // / Retrieve the location of this
588+ // / Retrieve the location of this conformance.
584589 SourceLoc getLoc () const { return Loc; }
585590
586591 // / Get the declaration context that contains the conforming extension or
@@ -629,6 +634,10 @@ class NormalProtocolConformance : public RootProtocolConformance,
629634 return Bits.NormalProtocolConformance .IsPreconcurrency ;
630635 }
631636
637+ // / Retrieve the location of `@preconcurrency`, if there is one and it is
638+ // / known.
639+ SourceLoc getPreconcurrencyLoc () const { return PreconcurrencyLoc; }
640+
632641 // / Determine whether we've lazily computed the associated conformance array
633642 // / already.
634643 bool hasComputedAssociatedConformances () const {
0 commit comments