@@ -530,6 +530,9 @@ class NormalProtocolConformance : public RootProtocolConformance,
530
530
// / The location of this protocol conformance in the source.
531
531
SourceLoc Loc;
532
532
533
+ // / The location of the `@preconcurrency` attribute, if any.
534
+ SourceLoc PreconcurrencyLoc;
535
+
533
536
// / The declaration context containing the ExtensionDecl or
534
537
// / NominalTypeDecl that declared the conformance.
535
538
DeclContext *Context;
@@ -562,10 +565,12 @@ class NormalProtocolConformance : public RootProtocolConformance,
562
565
NormalProtocolConformance (Type conformingType, ProtocolDecl *protocol,
563
566
SourceLoc loc, DeclContext *dc,
564
567
ProtocolConformanceState state, bool isUnchecked,
565
- bool isPreconcurrency)
568
+ bool isPreconcurrency,
569
+ SourceLoc preconcurrencyLoc)
566
570
: RootProtocolConformance(ProtocolConformanceKind::Normal,
567
571
conformingType),
568
- Protocol (protocol), Loc(loc), Context(dc) {
572
+ Protocol (protocol), Loc(loc), PreconcurrencyLoc(preconcurrencyLoc),
573
+ Context(dc) {
569
574
assert (!conformingType->hasArchetype () &&
570
575
" ProtocolConformances should store interface types" );
571
576
setState (state);
@@ -580,7 +585,7 @@ class NormalProtocolConformance : public RootProtocolConformance,
580
585
// / Get the protocol being conformed to.
581
586
ProtocolDecl *getProtocol () const { return Protocol; }
582
587
583
- // / Retrieve the location of this
588
+ // / Retrieve the location of this conformance.
584
589
SourceLoc getLoc () const { return Loc; }
585
590
586
591
// / Get the declaration context that contains the conforming extension or
@@ -629,6 +634,10 @@ class NormalProtocolConformance : public RootProtocolConformance,
629
634
return Bits.NormalProtocolConformance .IsPreconcurrency ;
630
635
}
631
636
637
+ // / Retrieve the location of `@preconcurrency`, if there is one and it is
638
+ // / known.
639
+ SourceLoc getPreconcurrencyLoc () const { return PreconcurrencyLoc; }
640
+
632
641
// / Determine whether we've lazily computed the associated conformance array
633
642
// / already.
634
643
bool hasComputedAssociatedConformances () const {
0 commit comments